Skip to content

julianschick/parts2kicad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parts2kicad

Extracts KiCad symbols, footprints and 3D models from SamacSys partlib zip files as you download them for instance via Mouser or Farnell.

This is done as follows:

flowchart LR

X123.kicad_sym["`X123.kicad_symbol
_KiCad Schematic Symbol_`"]

X123.kicad_mod["`X123.kicad_mod
_KiCad Footprint_`"]

X123.stp["`X123.stp
_3D Model_`"]

symfile["`Gets added to _mylibrary.kicad_sym_`"]
fprintfile["`Gets copied to _mylibrary.pretty/X123.kicad_mod_`"]
d3file["`Gets copied to _mylibrary.3dshapes/X123.stp_`"]

Zip["Zip Archive"]

Zip --> X123.kicad_sym --> symfile
Zip --> X123.kicad_mod --> fprintfile
Zip --> X123.stp --> d3file
Loading

So that you can keep all your downloaded stuff together at one place and do not have to fiddle inside the symbol libraries by yourself. The path to the 3D model in the footprint file is set to a relative path of the form ../mylibrary.3dshapes/X123.stp. Thus, you can move your lib freely around your hard drive. Only if you rename it, the links from footprint to 3D model break.

The script is mainly intended for Unixoid users (the official downloading tool only runs on Windows) and those who prefer command line over graphical UI.

Installation

So far via PyPi: pip install parts2kicad.

Usage

Usage is as easy as typing

$ p2k some.zip -t mylibrary.kicad_sym

You can also glob over a bunch of zip archives:

$ p2k ~/downloads/*.zip -t mylibrary.kicad_sym

Screenshots

Example Command Help Message

Project Pages

Technical Background

All in all the main ingredient is a whitespace aware S-Expression parser. It is needed for adding Symbols to the .kicad_sym library files without destroying the format. The format is normally (and also by KiCad specification) nicely indented, so that manual editing is also possible. Footprints and 3D models are luckily managed on file level.

About

Command line tool for adding footprints, symbols and 3D models to KiCad libraries

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages