Generic filter

This filter is based on regular expressions.
It also provides some shortcuts for common situations.
Note that matches aren’t case sensitive and spaces at the beginning and the end are removed.
The internal _mechanical filter emulates the KiBoM behavior for default exclusions.
The internal _kicost_dnp filter emulates KiCost’s dnp field.

  • comment : [string] (default: '') A comment for documentation purposes.

  • name : [string] (default: '') Used to identify this particular filter definition.

  • config_field : [string] (default: 'Config') Name of the field used to classify components.

  • config_separators : [string] (default: ' ,') Characters used to separate options inside the config field.

  • exclude_all_hash_ref : [boolean] (default: false) Exclude all components with a reference starting with #.

  • exclude_any : [BoMRegex parameters] [list(dict)] (default: []) A series of regular expressions used to exclude parts. If a component matches ANY of these, it will be excluded.
    Column names are case-insensitive.

  • exclude_bottom : [boolean] (default: false) Exclude components on the bottom side of the PCB.

  • exclude_config : [boolean] (default: false) Exclude components containing a key value in the config field. Separators are applied.

  • exclude_empty_val : [boolean] (default: false) Exclude components with empty ‘Value’.

  • exclude_field : [boolean] (default: false) Exclude components if a field is named as any of the keys.

  • exclude_kicad_dnp : [boolean] (default: false) Exclude components marked Do not populate in KiCad (KiCad 7+) For the bom output also use kicad_dnp_applied: ‘no’.

  • exclude_not_in_bom : [boolean] (default: false) Exclude components marked Exclude from bill of materials (KiCad 6+).

  • exclude_not_on_board : [boolean] (default: false) Exclude components marked Exclude from board (KiCad 6+).

  • exclude_refs : [list(string)] (default: []) List of references to be excluded. Use R* for all references with R prefix.

  • exclude_smd : [boolean] (default: false) Exclude components marked as smd in the PCB.

  • exclude_tht : [boolean] (default: false) Exclude components marked as through-hole in the PCB.

  • exclude_top : [boolean] (default: false) Exclude components on the top side of the PCB.

  • exclude_value : [boolean] (default: false) Exclude components if their ‘Value’ is any of the keys.

  • exclude_virtual : [boolean] (default: false) Exclude components marked as virtual in the PCB.

  • include_only : [BoMRegex parameters] [list(dict)] (default: []) A series of regular expressions used to include parts. If there are any regex defined here, only components that match against ANY of them will be included.
    Column/field names are case-insensitive.
    If empty this rule is ignored.

  • invert : [boolean] (default: false) Invert the result of the filter.

  • keys : [string | list(string)] (default: 'dnf_list') (choices: “dnc_list”, “dnf_list”) (also accepts any string) List of keys to match. The dnf_list and dnc_list internal lists can be specified as strings.
    Use dnf_list for [‘dnf’, ‘dnl’, ‘dnp’, ‘do not fit’, ‘do not load’, ‘do not place’, ‘no stuff’, ‘nofit’, ‘noload’, ‘noplace’, ‘nostuff’, ‘not fitted’, ‘not loaded’, ‘not placed’].
    Use dnc_list for [‘dnc’, ‘do not change’, ‘fixed’, ‘no change’].

Used dicts