This is just some example code to demonstrate how python can be used with KiCad 9.0 to automate some interactions with KiCad. It uses both the CLI and API along with some manual PDF manipulation to generate a custom design document summarising details of the project.
You can read more about it here
- Create a virtual environment and pip install requirements.txt
python -m venv .venv.venv/Scripts/activatepip install -r requirements.txt
- NOTES:
- this makes changes to your project, it updates the Board file layers User.1, User.2 and User.3
- It is recommended to commit your files to version control before running, so if it makes unintended changes, you can undo them.
- This tool is mainly a demonstration, it has not been tested on many designs.
- The tool expects KiCad 9 files
- The tool only expects a single schematic file, so if there are multiple it only generates one from the last file found.
- Open the Board file in KiCad.
- Run the script in the virtual environment.
python prepare_outputs.py <path to KiCad project folder>
An example of the tool being applied to a project can be seen in the Example folder.