SkillAgentSearch skills...

KiBoM

Configurable BoM generation tool for KiCad EDA (http://kicad.org/)

Install / Use

/learn @SchrodingersGat/KiBoM
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

KiBoM

License: MIT PyPI Coverage Status

Configurable BoM generation tool for KiCad EDA (http://kicad.org/)

Description

KiBoM is a configurable BOM (Bill of Materials) generation tool for KiCad EDA. Written in Python, it can be used directly with KiCad software without the need for any external libraries or plugins.

KiBoM intelligently groups components based on multiple factors, and can generate BoM files in multiple output formats.

BoM options are user-configurable in a per-project configuration file.

Installation

KiBoM can be installed via multiple methods:

A. Download

Download the KiBoM package from github and extract the .zip archive to a location on your computer.

B. Git Clone

Use git to clone the source code to your computer:

git clone https://github.com/SchrodingersGat/kibom

C. PIP

KiBom can also be installed through the PIP package manager:

pip install kibom

Note: Take note of which python executable you use when installing kibom - this is the same executable you must use when running the KiBom script from KiCAD (more details below under "Usage")

Installing under PIP is recommended for advanced users only, as the exact location of the installed module must be known to properly run the script from within KiCad.

Usage

The KiBOM_CLI script can be run directly from KiCad or from the command line. For command help, run the script with the -h flag e.g.

python KiBOM_CLI.py -h

usage: KiBOM_CLI.py [-h] [-n NUMBER] [-v] [-r VARIANT] [--cfg CFG]
                    [-s SEPARATOR]
                    netlist output

KiBOM Bill of Materials generator script

positional arguments:
  netlist               xml netlist file. Use "%I" when running from within
                        KiCad
  output                BoM output file name. Use "%O" when running from
                        within KiCad to use the default output name (csv
                        file). For e.g. HTML output, use "%O.html"

optional arguments:
  -h, --help            show this help message and exit
  -n NUMBER, --number NUMBER
                        Number of boards to build (default = 1)
  -v, --verbose         Enable verbose output
  -r VARIANT, --variant VARIANT
                        Board variant(s), used to determine which components are
                        output to the BoM
  -d SUBDIRECTORY, --subdirectory SUBDIRECTORY
                        Subdirectory (relative to output file) within which the
                        BoM(s) should be written.
  --cfg CFG             BoM config file (script will try to use 'bom.ini' if
                        not specified here)
  -s SEPARATOR, --separator SEPARATOR
                        CSV Separator (default ',')
  -k, --no-colon-sep    Don't use : as delimiter in the config file
  --version             show program's version number and exit


netlist The netlist must be provided to the script. When running from KiCad use "%I"

output This is the path to the BoM output. When running from KiCad, usage "%O" for the default option

  • If a suffix is not specified, CSV output format will be used
  • HTML output can be specified within KiCad as: "%O.html" or "%O_BOM.html" (etc)
  • XML output can be specified within KiCad as: "%O.xml" (etc)
  • XSLX output can be specified within KiCad as: "%O.xlsx" (etc)

-n --number Specify number of boards for calculating part quantities

-v --verbose Enable extra debugging information

-r --variant Specify the PCB variant(s). Support for arbitrary PCB variants allows individual components to be marked as 'fitted' or 'not fitted' in a given variant. You can provide muliple variants comma-separated. You can generate multiple BoMs at once for different variants by using semicolon-separation.

-d --subdirectory Specify a subdirectory (from the provided output file) into which the boms should be generated.

--cfg If provided, this is the BoM config file that will be used. If not provided, options will be loaded from "bom.ini"

-s --separator Override the delimiter for CSV or TSV generation

-k --no-colon-sep Only accept = as a delimiter for KEY/VALUE pairs in the config file, enables the use of : in field names


To run from KiCad, simply add the same command line in the Bill of Materials script window. e.g. to generate a HTML output:

alt tag

Quick Start

Download and unzip the files almost anywhere.

When you start the KiCad schematic editor and choose Tools>Generate Bill of Materials expect a Bill of Material dialog. Choose the Add Plugin button, expect a file chooser dialog. Navigate to where you unzipped the files, select the KiBOM_CLI.py file, and choose the Open button. Expect another confirmation dialog and choose OK. Expect the Command Line: text box to be filled in, and for a description of the plugin to appear in the Plugin Info text box. Choose the Generate button. Expect some messages in the Plugin Info text box, and for a .csv file to exist in your KiCad project directory.

If you want other than .csv format, edit the Command Line, for example inserting ".html" after the "%O".

If you want more columns in your BoM, before you generate your BoM, in the schematic editor choose Preferences>Schematic Editor Options and create new rows in the Template Field Names tab. Then edit your components and fill in the fields. KiBoM will reasonably sum rows in the BoM having the same values in your fields. For example, if you have two components both with Vendor=Digikey and SKU=877-5309 (and value and footprints equal), there will be one row with Quantity "2" and References e.g. "R1, R2."

Features

Intelligent Component Grouping

To be useful for ordering components, the BoM output from a KiCad project should be organized into sensible component groups. By default, KiBoM groups components based on the following factors:

  • Part name: (e.g. 'R' for resistors, 'C' for capacitors, or longer part names such as 'MAX232') note: parts such as {'R','r_small'} (which are different symbol representations for the same component) can also be grouped together
  • Value: Components must have the same value to be grouped together
  • Footprint: Components must have the same footprint to be grouped together (this option can be enabled/disabled in the bom.ini configuration file)

Custom Column Grouping

If the user wishes to group components based on additional field values, these can be specified in the preferences (.ini) file

Intelligent Value Matching

Some component values can be expressed in multiple ways (e.g. "0.1uF" === "100n" for a capacitor). KiBoM matches value strings based on their interpreted numerical value, such that components are grouped together even if their values are expressed differently.

Field Extraction

In addition to the default KiCad fields which are assigned to each component, KiBoM extracts and custom fields added to the various components.

Default Fields

The following default fields are extracted and can be added to the output BoM file:

  • Description : Part description as per the schematic symbol
  • References : List of part references included in a particular group
  • Quantity : Number of components included in a particular group
  • Part : Part name as per the schematic symbol
  • Part Lib : Part library for the symbol (default - not output to BoM file)
  • Footprint : Part footprint
  • Footprint Lib : Part footprint library (default - not output to BoM file)
  • Datasheet : Component datasheet extracted either from user-included data, or from part library

User Fields

If any components have custom fields added, these are available to the output BoM file.

Joining Fields

The user may wish to have separate fields in the output BOM file. For example, multiple component parameters such as [Voltage / Current / Tolerance] could be joined into the Value field in the generated BOM file.

Field joining is configured in the bom.ini file. Under the [JOIN] section in the file, multiple join entries can be specified by the user to be joined. Each line is a separate entry, which contains two or more tab-separated field names.

The first name specifies the primary field which be displayed in the output file. The following names specifiy fields which will be joined into the primary field.

Example:

[JOIN]
Value    Voltage  Current  Tolerance

This entry will append the voltage, current and tolerance values into the value field.

Multiple PCB Configurations

KiBoM allows for arbitrary PCB configurations, which means that the user can specify that individual components will be included or excluded from the BoM in certain circumstances.

The preferences (.ini) file provides the fit_field option which designates a particular part field (default = "Config") which the user can specify whether or not a part is to be included.

DNF Parts

To specify a part as DNF (do not fit), the fit_field field can be set to one of the following values: (case insensitive)

  • "dnf"
  • "do not fit"
  • "nofit"
  • "not fitted"
  • "dnp"
  • "do not place"
  • "no stuff"
  • "nostuff"
  • "noload"
  • "do not load"

DNC Parts

Parts can be marked as do not change or fixed by specifying the dnc attribute in the fit_field field.

Note:

If the Value field for the component contains any of these values, the component will also not be included

PCB Variants

To generate a BoM with a custom Variant,

Related Skills

View on GitHub
GitHub Stars373
CategoryDevelopment
Updated1mo ago
Forks93

Languages

Python

Security Score

95/100

Audited on Feb 14, 2026

No findings