pymap.filter
¶
- pymap.filter.filters: Plugin[FilterCompilerInterface[Any]] = Plugin('pymap.filter')¶
Registers filter compiler plugins.
- class pymap.filter.PluginFilterSet(plugin_name, value_type)[source]¶
Base class for filter set implementations that use a filter compiler declared in the
pymap.filter
entry point. The declared entry points must sub-classFilterCompiler
.- Parameters:
plugin_name (str | None) – The filter plugin name, or
None
for default.value_type (type[FilterValueT]) – The filter value representation type.
- property compiler: FilterCompilerInterface[FilterValueT]¶
Compiles filter values into an implementation.
- class pymap.filter.SingleFilterSet(*args, **kwargs)[source]¶
Base class for a filter set that does not use named filter implementations, it contains only a single active filter implementation.
- async put(name, value)[source]¶
Add or update the named filter value.
- Parameters:
name (str) – The filter name.
value (FilterValueT) – The filter value.
- Return type:
None
- async delete(name)[source]¶
Delete the named filter. If the named filter is active,
ValueError
is raised.
- async rename(before_name, after_name)[source]¶
Rename the filter, maintaining its active status. An exception is raised if
before_name
does not exist orafter_name
already exists.
- async get(name)[source]¶
Return the named filter value.
- async replace_active(value)[source]¶
Replace the current active filter value with a new value.
- Parameters:
value (FilterValueT | None) – The new filter value.
- Return type:
None
- abstract async get_active()[source]¶
Return the active filter value, if any.
- Return type:
FilterValueT | None