Scripts, templates, and examples for managing KiCad projects.
Project description
Welcome to kicad-helpers
Scripts, templates, and examples for managing KiCad projects
Project goals
- provide a sensible default structure and scripts for managing KiCad projects
- automate everything that can be automated with continuous integrations scripts (e.g., update BOMs, produce manufacturing files, run tests, generate documentation, etc.)
- configure git and KiCad to play nicely together
- support customization via command line arguments, environment variables, etc.
- make everything easy to install/setup/use
- make awesome documentation
Install
> pip install kicad_helpers
Setup a new project
Open a command line shell and navigate to the directory containing your KiCad project. Then run kh_update
to apply various project templates to the project directory:
> cd kicad/project/path
> kh_update
By default, this will install the following templates:
- .github/workflows/build.yml: a github workflow for updating the BOM, producing manufacturing files, running tests, generating documentation, etc.
- kitspace.yaml: metadata file for the kitspace service
- .kicad_helpers_config/config.kibot.yaml: configuration file for KiBot which allow automation of various KiCad actions
- .kicad_helpers_config/manufacturers/PCBWay.kibot.yaml: KiBot configuration to generate manufacturing files for PCBWay
To overwrite existing templates, run kh_update
with the --overwrite
flag:
> kh_update --v --overwrite
Rendering kitspace.yaml template.
Rendering settings.ini template.
Rendering .github/workflows/build.yml template.
Rendering .kicad_helpers_config/config.kibot.yaml template.
Rendering .kicad_helpers_config/manufacturers/PCBWay.kibot.yaml template.
Rendering tests/tests.ipynb template.
To see the options that are available, run the command:
> kh_update --help
usage: kh_update [-h] [--v] [--overwrite] [--root ROOT]
Install various templates from the `kicad_helpers/templates` directory (ignoring anything in the project's `.gitignore`
list).
optional arguments:
-h, --help show this help message and exit
--v verbose (default: False)
--overwrite overwrite existing templates (default: False)
--root ROOT project root directory (default: .)
Export a BOM from the KiCad schematic
> kh_sch_to_bom --v
/home/ryan/miniconda3/envs/kh/bin/python3.9 -m kifield --nobackup --overwrite --group -aq -x /mnt/c/Users/ryan/OneDrive/dev/python/kicad-helpers/_temp/40-channel-hv-switching-board.sch -i /mnt/c/Users/ryan/OneDrive/dev/python/kicad-helpers/_temp/manufacturing/default/40-channel-hv-switching-board-BOM.csv
Import data from the BOM into the KiCad schematic
> kh_sch_to_bom --v
/home/ryan/miniconda3/envs/kh/bin/python3.9 -m kifield --nobackup --overwrite --fields ~quantity -x /mnt/c/Users/ryan/OneDrive/dev/python/kicad-helpers/_temp/manufacturing/default/40-channel-hv-switching-board-BOM.csv -i /mnt/c/Users/ryan/OneDrive/dev/python/kicad-helpers/_temp/40-channel-hv-switching-board.sch
Run all tests in the tests
directory
> kh_test
testing /mnt/c/Users/ryan/OneDrive/dev/python/kicad-helpers/_temp/tests/Tests.ipynb
All tests are passing!
Contributors
- Ryan Fobel (@ryanfobel)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kicad_helpers-0.9.tar.gz
(21.6 kB
view hashes)
Built Distribution
Close
Hashes for kicad_helpers-0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d704acf921492891d91491c78de1b8b6d2501fb5f738181af7abcad2a6dd3dac |
|
MD5 | d44d11dc56756de567b1ad22d618ec3b |
|
BLAKE2b-256 | 0d32e3742480929e5b3c9651e55190fd645032c3e4f0074beb7644a154b9ad7f |