filters

class FiltersMixin(
use_filters: bool = False,
filters=NOTHING,
*,
extra_keys: dict[str, Any] | None = None,
)

Allows the entity to specify item filters.

property filter_count : int | None

The number of filter slots that this Entity has in total. Equivalent to the "filter_count" key in Factorio’s data.raw. Returns None if this entity’s name is not recognized by Draftsman.

filters : list[ItemFilter]

Serialized

This attribute is imported/exported from blueprint strings.

The manually-set item filters that this inserter/loader will abide by. These values are overridden by filters set by the circuit network, if so configured.

use_filters : bool

Serialized

This attribute is imported/exported from blueprint strings.

Whether or not this inserter should use filters at all. Overrided by circuit_set_filters, if present.

set_item_filter(
index: int,
item: str,
quality: 'normal' | 'uncommon' | 'rare' | 'epic' | 'legendary' | 'quality-unknown' = 'normal',
comparator: '>' | '<' | '=' | '==' | '≥' | '>=' | '≤' | '<=' | '≠' | '!=' = '=',
)

Sets one of the item filters of the Entity.

Parameters:
index: int

The index of the filter to set. Should be less than filter_count.

item: str

The string name of the item to filter.

quality: 'normal' | 'uncommon' | 'rare' | 'epic' | 'legendary' | 'quality-unknown' = 'normal'

The item’s quality.

comparator: '>' | '<' | '=' | '==' | '≥' | '>=' | '≤' | '<=' | '≠' | '!=' = '='

In what manner should the quality of the filter be interpreted - defaults to an exact match ("="), but can also be specified as a range.