Skip to main content

KiCad Package Manager

This is a package manager for KiCad symbols, footprints, 3d models, simulation files, and hierarchical sheets.

Goal

Create a format for distributing the following kind of KiCad features:

  • Symbols
  • Footprints
  • 3D Models
  • SPICE Simulation Code
  • Sub-sheets
  • Unit Tests
  • Command Runner
  • Plugins

Projects can be created that programmatically generate these files.

Currently Supports:

  • Symbols
  • Footprints

Up Next:

  • Subsheets
  • Command Runner
  • 3D Models

Installing KPM

Open the "KiCad Command Prompt"

pip3 install kicad-package-manager

In your KiCad project directory, run

kpm init

Then edit your kpm.json file as needed.

How to Install a Package

Find a package you want to use:

kpm list
kpm list | grep something
kpm search something
kpm show some_package

Then edit the dependencies list in your kpm.json to include a package and version. Example:

{
	"name": "cool-project",
	"version": "0.0.1",
	"author": "danroblewis",
	"homepage": "http://githab.info/magic/stuff",
	"commands": {
		"test": "./fictional-spice-tester"
	},
	"dependencies": {
		"kpm-jlcpcb-basic": "0.0.5",
		"eurorack-parts": "0.0.1"
	}
}

How to Create a Package

Create a directory, it can be a KiCad project directory or any directory. Probably put it under version control with something like git.

kpm init

This creates a kpm.json file. Add the dependencies your package will require to the dependencies list.

Your package will include your kpm.json file and any of these directories if they are present:

/symbols
/footprints
/commands
/3dmodels
/plugins
/simulation
/subsheets
/tests
/commands

To build the package

kpm build

You should now have a package.zip file in your project directory.

To upload a package to the registry, first create a ~/.kpmrc file:

{
	"name": "yourname",
	"token": "arbitrarytokenonlyyouknow"
}

Then update the version in your kpm.json file.

Then run

kpm upload

You should then see your package in the kpm search <yourpackagename>

Writing Commands

A command is ran with kpm run <commandname> <arguments>.

If you'd like to create a package that adds a new command to kpm, create a file commands/__init__.py:

def register(subparsers):
	print("registering mycommand")
	parser = subparsers.add_parser('mycommand')
	parser.add_argument('thing')
	parser.add_argument('--feature', '-f', action="store_true", required=False)


def run_command(args):
	if args.command == 'mycommand':
		print(args.thing)
		print(args.feature)

Usage

kpm init
kpm list
kpm search jlc
kpm show kpm-jlcpcb-basic
kpm install .

To add a new package to the package index, submit a pull request

kpm.json

{
	"name": "cool-project",
	"version": "0.0.1",
	"author": "danroblewis",
	"homepage": "http://githab.info/magic/stuff",
	"commands": {
		"test": "./fictional-spice-tester"
	},
	"dependencies": {
		"kpm-jlcpcb-basic": "0.0.5",
		"eurorack-parts": "0.0.1"
	}
}

Refresh Symbols and Footprints

After updating your libraries, the symbols/footprints in your schematic files won't have the latest changes. Do this to synchronize them:

  • In eeschema, click Tools > Update Symbols from Library..., then save
  • In pcbnew, click Tools > Update Footprints from Library..., then save

(If we can find a way to do this within kpm, that would be awesome.)

Package Directory Structure

/kpm.json

/symbols/
/symbols/mysymbols.kicad_sym

/footprints/
/footprints/myfootprints.pretty/
/footprints/myfootprints.pretty/myfootprints.kicad_mod

/3dmodels/
/3dmodels/something.step

/plugins/
/plugins/kicad-eurorack-tools/
/plugins/kicad-eurorack-tools/__init__.py

/simulation/
/simulation/mysim.spice

/sheets/
/sheets/mysubsheet.kicad_sch

/tests/
/tests/mytest.py

/scripts/
/scripts/mycommand.py

Release files for kicad-package-manager 0.0.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kicad-package-manager 0.0.23
File Size Uploaded
kicad_package_manager-0.0.23.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kicad-package-manager 0.0.23
File Interpreter ABI Platform
kicad_package_manager-0.0.23-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 24.1 kB

Release files / kicad_package_manager-0.0.23.tar.gz

Download URL kicad_package_manager-0.0.23.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
92d1f21decfda64594b9a2d3967bd38d77565ca084fca9c3c95621ac10809629
BLAKE2b-256 checksum
How to use checksums
5f9806fe865f6c3b5246eacdcdc12a78b70748ae295efebb43249dda3d720628
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release files / kicad_package_manager-0.0.23-py2.py3-none-any.whl

Download URL kicad_package_manager-0.0.23-py2.py3-none-any.whl
Size 12.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e8b241c73b42c9c15e0a571ec39fb2e108f6dfc681603b881fb9847bf829e481
BLAKE2b-256 checksum
How to use checksums
86fb0bbd113c6c31fe3a9e66d2bc1372185fb2a652c5d0f4429fbce9e2481027
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.23 This release

2 release files

0.0.22

1 release file

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page