Skip to content

Instantly share code, notes, and snippets.

@ebenolson
Created January 4, 2019 21:14
Show Gist options
  • Save ebenolson/07af5bf0919dfa7f5585577ad073c120 to your computer and use it in GitHub Desktop.
Save ebenolson/07af5bf0919dfa7f5585577ad073c120 to your computer and use it in GitHub Desktop.
KiCAD Python script to convert old .mod footprint libraries to .kicad_mod
import sys
from pcbnew import *
infile = sys.argv[1]
outdir = sys.argv[2]
inplugin = IO_MGR.PluginFind(IO_MGR.GuessPluginTypeFromLibPath(infile))
outplugin = IO_MGR.PluginFind(IO_MGR.GuessPluginTypeFromLibPath(outdir))
for name in inplugin.FootprintEnumerate(infile):
fp = inplugin.FootprintLoad(infile, name)
outplugin.FootprintSave(outdir, fp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment