mafw.tools.filter_files

Shared extraction, validation and overlay of external filter TOML.

Added in version 2.4.

Author:

MAFw developers

Module Attributes

log

Logger for dormant filter scopes.

Functions

atomic_write(path, text)

Serialize safely through a temporary file beside the destination.

drop_filters(config)

Copy steering data with filter definitions removed, retaining new-only settings.

extract_filters(config)

Copy explicit filter definitions and new-only settings into TOML.

overlay_filters(config, overlays)

Copy configuration and replace matching model definitions in order.

read_filters(path)

Read and validate an external filter file without loading plugins.

strip_filters(config)

Copy steering data with filters removed, retaining new-only settings.

validate_filters(config)

Reject non-filter entries and validate existing filter expressions.

mafw.tools.filter_files.atomic_write(path: Path | str, text: str) → None[source]

Serialize safely through a temporary file beside the destination.

Added in version 2.4.

mafw.tools.filter_files.drop_filters(config: Mapping[str, Any]) → Any[source]

Copy steering data with filter definitions removed, retaining new-only settings.

Added in version 2.4.

mafw.tools.filter_files.extract_filters(config: Mapping[str, Any]) → TOMLDocument[source]

Copy explicit filter definitions and new-only settings into TOML.

Added in version 2.4.

mafw.tools.filter_files.overlay_filters(config: Mapping[str, Any], overlays: Sequence[Mapping[str, Any]]) → Any[source]

Copy configuration and replace matching model definitions in order.

Added in version 2.4.

mafw.tools.filter_files.read_filters(path: Path | str) → TOMLDocument[source]

Read and validate an external filter file without loading plugins.

Added in version 2.4.

mafw.tools.filter_files.strip_filters(config: Mapping[str, Any]) → Any[source]

Copy steering data with filters removed, retaining new-only settings.

Added in version 2.4.

mafw.tools.filter_files.validate_filters(config: Mapping[str, Any]) → None[source]

Reject non-filter entries and validate existing filter expressions.

Added in version 2.4.

mafw.tools.filter_files._KEYS = {'__filter__', '__logic__', '__new_only__'}

Filter-related processor entries.

mafw.tools.filter_files.log = <Logger mafw.tools.filter_files (WARNING)>[source]

Logger for dormant filter scopes.