- Python 93.6%
- Nix 6.4%
|
All checks were successful
Build parts database / build-parts-db (push) Successful in 3s
|
||
|---|---|---|
| .forgejo/workflows | ||
| 3dmodels | ||
| footprints/Team.pretty | ||
| symbols | ||
| tests | ||
| .envrc | ||
| .gitignore | ||
| build_parts_db.py | ||
| flake.lock | ||
| flake.nix | ||
| fp-lib-table | ||
| parts.kicad_dbl | ||
| parts.yaml | ||
| README.md | ||
| requirements.txt | ||
| sym-lib-table | ||
kicad-libs
Shared KiCad 10 symbol / footprint library.
The catalogue is a KiCad database library.
parts.yaml in this repo is the source of truth.
build_parts_db.py validates it against the symbol, footprint and 3D-model files and generates build/parts.sqlite.
KiCad reads that database through parts.kicad_dbl, registered in the shared sym-lib-table.
CI builds the database and attaches it to a release, but every user can also build it locally.
Building the parts database
Nix (recommended)
nix run .
->
build/parts.sqlite
Pip
With Python 3.11+:
python3 -m pip install -r requirements.txt
python3 build_parts_db.py
->
build/parts.sqlite
One-time setup for each user
KiCad 10 is required.
-
Clone the repo to a fixed path (e.g.
C:\kicad-libs/~/kicad-libs):git clone https://git.sid.ovh/sid/kicad-libs.git ~/kicad-libs -
Define a path variable so all paths resolve the same on every machine:
- Preferences -> Configure Paths... -> add
KICAD_LIBS= the clone path.
- Preferences -> Configure Paths... -> add
-
Register the shared symbol table:
- Preferences -> Manage Symbol Libraries... -> Add empty row to table
- Library Path:
${KICAD_LIBS}/sym-lib-table - Open Library Table to verify
-
Register the shared footprint table:
- Preferences -> Manage Footprint Libraries... -> Add empty row to table
- Library Path:
${KICAD_LIBS}/fp-lib-table - Open Library Table to verify
Adding / updating a part
- Add or edit the symbol under
symbols/, its footprint underfootprints/, and its 3D model under3dmodels/(referenced from the footprint). - Add a part entry to
parts.yamlwith the symbol LIB_ID, one or more footprints, and one or more MPNs. - Run
python3 build_parts_db.pyto validate and rebuild locally. - Push to a branch, open a merge request, and merge into
master. - Everyone else pulls and re-runs the builder (or downloads the parts database from the release page).
MPN variants
One symbol can serve many MPNs and several footprints. parts.yaml groups them:
version: 1
parts:
- id: STM32G474RET6
symbol: Team_MCUs:STM32G474RET6
value: STM32G474RET6
description: ARM Cortex-M4 MCU, 512KB flash, 128KB SRAM, 170MHz, LQFP-64
datasheet: https://www.st.com/resource/en/datasheet/stm32g474cb.pdf
keywords: STM32G474RET6 STM32G4 Cortex-M4 MCU LQFP-64
footprints:
- footprint: Team:QFP50P1200X1200X160-64N
package: LQFP-64
mpns:
- mpn: STM32G474RET6
manufacturer: STMicroelectronics
Each MPN belongs to the footprint for its exact package. Do not share a footprint between different pin counts (such as a 64-pin and a 100-pin MCU).
The builder emits one database row per MPN.