kproj
KiCad project publisher for the SPCoast Hugo site.
kproj takes a point-in-time snapshot of a KiCad project (renders, schematic SVG/PDF, interactive HTML BOM, fabrication artifacts, KiCad source archive) and publishes it as a version entry on the SPCoast site.
Installation
pip install kproj
Requires Python ≥3.10. kproj needs a local kicad-cli install (KiCad 9.x or 10.x) to render/export artifacts, and the iBOM plugin installed into KiCad for the interactive BOM step.
Usage
kproj --version
kproj publish [<project-or-dir-or-file>] [options]
kproj list [<project-or-dir-or-file>] [--all] [--site-repo PATH]
kproj delete [<project-or-dir-or-file>] [--version <board_rev>] [--force] [--dry-run] [--no-push] [--site-repo PATH]
For publish, list, and delete, run from inside a KiCad project directory, or pass a path to a .kicad_pro / .kicad_sch / .kicad_pcb file, a project directory, or a basename resolved under the KiCad projects root. The project argument defaults to . (the current directory).
Pipeline: render → ibom → fab → publish. Each release generates board renders, schematic SVG/PDF, the interactive HTML BOM, packages fabrication artifacts, and commits (+ pushes) a version page and its assets into the configured site repo.
Project/site management commands
kproj list [project]— list published versions for one project in the configured site repo as a one-liner:project_name [versions...]. When omitted, the project defaults to.and resolves from CWD.kproj list --all— list all published projects, one line per project, using the same one-line format.kproj delete [project] --version <board_rev>— delete one published version.- If this is the last published version, the command fails unless
--forceis provided. - With
--forcein that last-version case, behavior escalates to full-project delete.
- If this is the last published version, the command fails unless
kproj delete [project]— non-destructive preview: prints what full-project deletion would remove, then exits non-zero.kproj delete [project] --force— delete all published versions and project content for that project.--dry-runworks for destructive delete paths and reports what would be removed without writing.--no-pushkeeps the delete commit local (batch-friendly), matching publish behavior.
CLI flags
Run kproj --help for the authoritative, up-to-date flag list. As of this writing:
--site-repo PATH— override the local site-repo checkout (highest precedence).--inventory PATH— inventory CSV to enrich the BOM with curated datasheet names. Unset means kproj never invokesjbomand publishes without datasheet deep-links.--fabricator FAB— jBOM fabricator profile (generic,jlc,pcbway,seeed) used for lookup item/header normalization. Default:jlc.--ibom-extra-fields FIELDS— comma-separated iBOM table fields to surface from inventory-enriched data (for exampleDetails,Description).--datasheet-library PATH— local datasheet-library clone used by the advisory publish guard.--datasheet-repo OWNER/REPO— public repo slug that published datasheet deep-links point at.--version— print the installed kproj version.--dry-run— read-only mode: collect findings without writing to the site repo.--republish/--force(publish command) — force artifact regeneration and publish even when unchanged checks would otherwise skip producers.--no-push— skipgit pushafter the site-repo commit (batch-friendly). Run N batch publishes with this flag, then run a final plainkprojto flush all queued site commits.-v/--verbose,-d/--debug— increase logging verbosity. Default and-vstderr show a compact findings summary;-dadditionally emits detailed per-finding rows for debugging.
Configuration
Every setting (except the project argument) follows a four-tier precedence, highest first:
- CLI flag
KPROJ_*environment variable~/.kproj.yaml- Hardcoded default
kproj --help documents the full precedence chain, every KPROJ_* environment variable, and a complete ~/.kproj.yaml example inline.
First-time setup
If ~/.kproj.yaml is absent and no inventory is configured, kproj emits a one-time informational hint pointing here — it still publishes successfully, just without datasheet deep-links.
Create ~/.kproj.yaml to configure kproj for your machine:
site_repo: /path/to/your/SPCoast.github.io
no_push: false
kicad_cli: /usr/local/bin/kicad-cli
inventory: /path/to/your/SPCoast-inventory/SPCoast-INVENTORY.csv
datasheet_library: /path/to/your/SPCoast-inventory
datasheet_repo: plocher/SPCoast-inventory
ibom_extra_fields: Details,Description
fabricator: jlc
Every key is optional; omit what you don't need to override. site_repo and no_push control where and how kproj publishes; kicad_cli pins a specific executable instead of relying on auto-discovery; inventory / datasheet_library / datasheet_repo configure the datasheet deep-link feature below.
ibom_extra_fields controls which inventory-derived columns are surfaced in the generated iBOM table.
fabricator controls which jBOM fabricator profile is used for BOM lookup normalization (default jlc).
Datasheet deep-links
When inventory is configured, kproj queries jbom bom --inventory <path> --fabricator <fabricator> -f "reference,datasheet,datasheet_name" -o - live at publish time and deep-links each curated Datasheet Name into the shared datasheet-library repo (view + download URLs) — no PDFs are copied into the site. Lookup parsing accepts both generic and JLC-oriented header names (Reference/Designator, Description/Comment, Lcsc/LCSC Part #). Without an inventory, kproj never invokes jbom and publishes without datasheet links (an intentional, advisory-free degraded state, not an error).
Exit codes
0— clean: published (or refreshed/noop/private-skip) with no error/warning findings.1— findings present: the same outcomes above, but with at least one error or warning finding (audit, DRC/ERC, etc.). Stderr shows compact counts; detailed rows are in the version page's Markdown body (and on stderr under-d).2— mechanical failure: kicad-cli not found, project resolution failed, or another pipeline step raised.
Composition with other tools
kproj is one tool in a small ecosystem. The release-lifecycle workflow composes via Makefile (see templates/Makefile.kicad):
jbom fab— generates fabrication artifacts (bom.csv,pos.csv,gerbers.zip) into./production/. Invoked separately by the user beforekproj.kproj— reads./production/+ KiCad project files, publishes a snapshot to the SPCoast site.git tag+gh release create(manual or Makefile-driven) — the release-lifecycle layer, external to kproj.
Development
- Python ≥3.10;
uvfor environment + dependency management (uv sync,uv run). uv.lockis committed and authoritative for the development environment. Keep it fresh withuv lockwhenever dependency inputs change (including local../jBOMversion shifts). CI validates lock freshness on PRs, and release automation refreshesuv.lockafter semantic version bumps.pytest+behavefor testing;ruff+mypyfor lint/type-checking;pre-commithooks configured.docs/DESIGN.mdhas the implementation specs;docs/adr/has the Architecture Decision Records;CONTEXT.mdhas the canonical project vocabulary.docs/history.mdhas the retired v1-development phase tracker, for archival reference.
License
MIT — see LICENSE.
Metadata
Release files for kproj 0.13.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| kproj-0.13.4.tar.gz | 448.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kproj-0.13.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 598.6 kB
Release files / kproj-0.13.4.tar.gz
| Download URL | kproj-0.13.4.tar.gz |
|---|---|
| Size | 448.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
839c36d3257275412109336eba39311f287e2f3d750881556c5aced52744cae5
|
|
BLAKE2b-256 checksum How to use checksums |
369240ad668064930a35f7e3ef8126bfc369cf0f18f7ffc6227963110a9c67b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.20
|
Release files / kproj-0.13.4-py3-none-any.whl
| Download URL | kproj-0.13.4-py3-none-any.whl |
|---|---|
| Size | 150.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
73168c05a4e00fffed6573208d8b20f56975ee6f9fa8f737ba4854847c2f7fc1
|
|
BLAKE2b-256 checksum How to use checksums |
e29171a272d71444345d5b40a31c325df4cd169c173499d0afa45034bccf88a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.20
|
Security for kproj 0.13.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.