KiCad API Python Bindings
Actively maintained. Last release 4 days ago. A safe choice.
pip install kicad-pythonKiCad API Python Bindings
kicad-python is the official Python bindings for the KiCad IPC API. This
library makes it possible to develop scripts and tools that interact with a running KiCad session.
The KiCad IPC API replaces the legacy SWIG-based Python bindings for KiCad's PCB editor. The SWIG bindings still exist in KiCad 9 and 10, but are removed in KiCad 11.
For more information about the IPC API, please see the KiCad developer documentation. Specific documentation for developing add-ons is also available.
Note: Version 0.0.2 and prior of this package are an obsolete earlier effort and are unrelated to this codebase.
Requirements
Using the IPC API requires a suitable version of KiCad (9.0 or higher) and requires that KiCad be
running with the API server enabled in Preferences > Plugins. This package also depends on the
protobuf and pynng packages for communication with KiCad.
Note: Unlike the SWIG-based Python bindings, the IPC API requires communication with a running instance of KiCad. It is not possible to use
kicad-pythonto manipulate KiCad design files without KiCad running.
Contributing
We welcome contributions in the form of issue reports, feature requests, and merge requests.
All general policies from https://dev-docs.kicad.org/en/rules-guidelines/index.html apply to the
kicad-python project. Please make sure you have read all policies, especially the code
contribution and tool-generated content policies, before creating an issue or merge request.
Please try to open issues in the correct repository (here for Python binding issues; the main KiCad code repository for general API issues) if you're able to determine whether or not the issue is specific to the Python bindings. It's OK to make mistakes here; we'll just move the issue to the correct repository.
Building from Source
Most users should use kicad-python by installing the latest version from PyPI. You can also
build and install the library from this repository, to test unreleased changes or contribute to
the development. For instructions on how to do so, please see COMPILING.md.
Note that this library builds against the API definitions ( files) in the submodule. Official releases of the library to PyPI should use a tagged release of KiCad, but the development branch of may sometimes move the submodule pointer to non-tagged commits during the course of development. If you are using this library from source rather than from PyPI, remember to keep the submodule updated and to test against a suitable build of KiCad, which may need to be a nightly or testing build in some situations. You can use the method to make sure you are using a compatible version of for your installed version of KiCad.