Hi @PCB_Wiz, let me clarify a few things.
Kicad has a python api which is automatically created from the C++ API using a tool called SWIG. This API isn’t very pythonic, it feels like a c++ library and doesn’t have the ease of use and flexibility of python. So, some developers decided to create a wrapper around this API, called kicad-python. I believe their aim was to create a simpler and better documented scripting interface for kicad.
Notice that kicad-python
, doesn’t call the C++ API directly, so it isn’t a replacement of actual python API of kicad, but is a wrapper around it.
About my fork of kicad-python; it wasn’t actively developed at the time I saw it, so I decided to fork it and add some features. It’s far from complete, and I only add features as I need them.
Is it ever going to be merged to kicad? I don’t know.
To be able to use above code snippet, you should download/clone my kicad-python repository and add it to python path so that interpreter can import modules;
import sys
sys.path.append("/path/to/kicad-python/")
A tip; you can use function execfile()
function to run python scripts from the python command line.