用于管理KiCad项目的脚本、模板和示例。
项目描述
欢迎使用kicad-helpers
用于管理KiCad项目的脚本、模板和示例
项目目标
- 提供合理默认的结构和脚本,以管理KiCad项目
- 通过持续集成脚本自动化所有可自动化操作(例如,更新BOM、生成制造文件、运行测试、生成文档等)
- 配置git和KiCad以便友好协作
- 通过命令行参数、环境变量等支持自定义
- 使安装/设置/使用一切变得简单
- 制作出色的文档
安装
> pip install kicad_helpers
设置新项目
打开命令行shell并将路径切换到包含您的KiCad项目的目录。然后运行kh_update
以将各种项目模板应用到项目目录中
> cd kicad/project/path
> kh_update
默认情况下,这将安装以下模板
- .github/workflows/build.yml:更新BOM、生成制造文件、运行测试、生成文档等操作的github工作流程
- kitspace.yaml:kitspace服务的元数据文件
- .kicad_helpers_config/config.kibot.yaml:用于KiBot的配置文件,允许自动化各种KiCad操作
- .kicad_helpers_config/manufacturers/PCBWay.kibot.yaml:为KiBot配置生成PCBWay制造文件的配置
要覆盖现有模板,请使用带有--overwrite
标志的kh_update
命令
> kh_update --v --overwrite
Render kitspace.yaml template.
Render settings.ini template.
Render .github/workflows/build.yml template.
Render .kicad_helpers_config/drc.yaml template.
Render .kicad_helpers_config/erc.yaml template.
Render .kicad_helpers_config/pcb_pdf.yaml template.
Render .kicad_helpers_config/pcb_svg.yaml template.
Render .kicad_helpers_config/sch_pdf.yaml template.
Render .kicad_helpers_config/sch_svg.yaml template.
Render .kicad_helpers_config/manufacturers/default.yaml template.
Render .kicad_helpers_config/manufacturers/PCBWay.yaml template.
Render tests/Tests.ipynb template.
"*.pro filter=kicad_project" already exists in /home/ryan/dev/python/kicad-helpers/_temp/.gitattributes
"*.sch filter=kicad_sch" already exists in /home/ryan/dev/python/kicad-helpers/_temp/.gitattributes
Add filters to git config.
"_autosave*" already exists in /home/ryan/dev/python/kicad-helpers/_temp/.gitignore
"*bak" already exists in /home/ryan/dev/python/kicad-helpers/_temp/.gitignore
"*.xml" already exists in /home/ryan/dev/python/kicad-helpers/_temp/.gitignore
".ipynb_checkpoints" already exists in /home/ryan/dev/python/kicad-helpers/_temp/.gitignore
"*-erc.txt" already exists in /home/ryan/dev/python/kicad-helpers/_temp/.gitignore
"*-drc.txt" already exists in /home/ryan/dev/python/kicad-helpers/_temp/.gitignore
"kibot_errors.filter" already exists in /home/ryan/dev/python/kicad-helpers/_temp/.gitignore
要查看可用的选项,请运行以下命令
> kh_update --help
usage: kh_update [-h] [--v] [--overwrite] [--root ROOT]
Setup a new project (or update an existing project) with templates from the `kicad_helpers/templates` directory. Also
installs git filters to prevent insignificant changes to the kicad `*.pro` and `*.sch` files from being tracked by git
(see https://jnavila.github.io/plotkicadsch/ for more details).
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: .)
从KiCad原理图导出BOM
> kh_sch_to_bom --v
/home/ryan/miniconda3/envs/kh/bin/python3.9 -m kifield -r --nobackup --overwrite --group -aq -x /home/ryan/dev/python/kicad-helpers/_temp/40-channel-hv-switching-board.sch -i /home/ryan/dev/python/kicad-helpers/_temp/manufacturing/default/40-channel-hv-switching-board-BOM.csv
将BOM数据导入KiCad原理图
> kh_sch_to_bom --v
/home/ryan/miniconda3/envs/kh/bin/python3.9 -m kifield -r --nobackup --overwrite --fields ~quantity -x /home/ryan/dev/python/kicad-helpers/_temp/manufacturing/default/40-channel-hv-switching-board-BOM.csv -i /home/ryan/dev/python/kicad-helpers/_temp/40-channel-hv-switching-board.sch
运行tests
目录中的所有测试
> kh_test
testing /home/ryan/dev/python/kicad-helpers/_temp/tests/Tests.ipynb
All tests are passing!
贡献者
- Ryan Fobel (@ryanfobel)
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源代码分发
kicad_helpers-0.14.tar.gz (26.6 kB 查看哈希值)
构建分发
kicad_helpers-0.14-py3-none-any.whl (27.1 kB 查看哈希值)
关闭
kicad_helpers-0.14.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 53f50590338e01c2eafbce0ff250cdcf3596eda54c3314c00886080e175e65a8 |
|
MD5 | 7bb43d25b3556c708a850b8f9f9c1471 |
|
BLAKE2b-256 | 4b892d99511cba11238e6ea238daf8c92df94ef56e8aae7a2ad9194bb03e2c1f |
关闭
kicad_helpers-0.14-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | ab71dadd3e763fc721f60bea5c41ae79af26d66ab9fc1c0517cbfd554582efd2 |
|
MD5 | c53b86da2d682fd73446b35031521bb0 |
|
BLAKE2b-256 | 563a68db0561d3d952ca62ca458f06e6e3e4ba65e0a25aee04e9a2ca5581053c |