Script to archive KiCAD project. Place all used symbols, footprints, 3D models inside project directory and modify all paths in project files. KiCAD project become fully portable.
Note: after running script, you need to generate new netlist from Eeschema and update PCB footprints mannualy in Pcbnew.
- Read enviroment variables, to unroll all paths.
- Find all
.sch
files in the project directory recursively. - Extract list of all footprints used from
.sch
files. - Find all 3d models assigned to the footprints extracted.
- If does not exist, create dir
lib_fp.pretty
and copy all used footprints there. - If does not exist, create dir
3d_models
and copy all used 3d models there. - Assign 3d models from
3d_models
to footprints inlib_fp.pretty
with${KIPRJMOD}
based path. - Replace all footprints libs in
.sch
files tolib_fp
. - Find symbols cache and copy it as symbol library
$projname$.lib
to created directorylib_sym
. - Replace all footprints libs in symbol lib to
lib_fp
. - Replace all symbol libs in
.sch
files to$projname$.lib
.
Example:
python3 archive_project.py /home/foo/bar/projectname
More options:
python3 archive_project.py -h
Requirements:
- Python 3.5.0+
- Linux, Windows
- KiCAD 5 or KiCAD 6 Nightly Builds
Tested on:
- Fedora 28 KiCAD 6.0.0-rc1
- Windows 8.1 KiCAD 5.0.0