Package: kicad-package-manager
KiCad Package ManagerThis is a package manager for KiCad symbols, footprints, 3d models, simulation files, and hierarchical sheets.GoalCreate a format for distributing the following kind of KiCad features:SymbolsFootprints3D ModelsSPICE Simulation CodeSub-sheetsUnit TestsCommand RunnerPluginsProjects can be created that programmatically generate these files.Currently Supports:SymbolsFootprintsUp Next:SubsheetsCommand Runner3D ModelsInstalling KPMOpen the "KiCad Command Prompt"pip3installkicad-package-managerIn your KiCad project directory, runkpminitThen edit yourkpm.jsonfile as needed.How to Install a PackageFind a package you want to use:kpmlist
kpmlist|grepsomething
kpmsearchsomething
kpmshowsome_packageThen edit thedependencieslist in yourkpm.jsonto 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 PackageCreate a directory, it can be a KiCad project directory or any directory. Probably put it under version control with something like git.kpminitThis creates akpm.jsonfile. Add the dependencies your package will require to thedependencieslist.Your package will include yourkpm.jsonfile and any of these directories if they are present:/symbols
/footprints
/commands
/3dmodels
/plugins
/simulation
/subsheets
/tests
/commandsTo build the packagekpmbuildYou should now have apackage.zipfile in your project directory.To upload a package to the registry, first create a~/.kpmrcfile:{"name":"yourname","token":"arbitrarytokenonlyyouknow"}Then update the version in yourkpm.jsonfile.Then runkpmuploadYou should then see your package in thekpm search <yourpackagename>Writing CommandsA command is ran withkpm run <commandname> <arguments>.If you'd like to create a package that adds a new command tokpm, create a filecommands/__init__.py:defregister(subparsers):print("registering mycommand")parser=subparsers.add_parser('mycommand')parser.add_argument('thing')parser.add_argument('--feature','-f',action="store_true",required=False)defrun_command(args):ifargs.command=='mycommand':print(args.thing)print(args.feature)Usagekpminit
kpmlist
kpmsearchjlc
kpmshowkpm-jlcpcb-basic
kpminstall.To add a new package to the package index,submit a pull requestkpm.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 FootprintsAfter updating your libraries, the symbols/footprints in your schematic files won't have the latest changes. Do this to synchronize them:Ineeschema, clickTools > Update Symbols from Library..., then saveInpcbnew, clickTools > 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