KiCAD 6 Python Scripting

Looking for documentation and examples of Python scripting for KiCAD 6. Most everything out there seems to be 5.x and earlier.

So far what I’ve been able to put together has required intense digging through many websites as well as experimentation. Unless I am missing something fundamental, this seems to be an area (scripting documentation) in need of serious attention. I could take some of this on towards the end of this year if all works out.

I’ve been able to piece together a basic plugin to address a current need I have. Going much beyond that will require better documentation.

Thanks,

-Martin

There are generated docs for v6 and not much in terms of tutorials specifically for this version.

Keep in mind that this API will be deprecated and removed within next major version or two so I wouldn’t put much effort into manually documenting it. Especially since it’s a moving target unlike new stable API which is supposed to replace this.

1 Like

That’s one of the sources I’ve been using. It’s a bit on the painful side, discovery is difficult and there are no real examples to speak of anywhere I have looked. I’m managing. Yet, something that would have taken two or three hours of work with good documentation is taking all day (as in, a long 12+ hour day).

Existing plugins are good examples. Browse the plugin manager, it has source links for all plugins.

Will do. Thanks.

Even with these issues, coming from Altium Designer, the ability to script in KiCAD using Python is/will be a massive productivity booster. I’m just getting started, so it stands to reason that I don’t know my way around.

Back in P-CAD days (going back to the '90’s) I spent months writing custom VBA code to automate/accelerate various tasks. It is my full intent to port as much of that work as might be relevant to KiCAD and release it as open source. Same for other tools I have authored over the years in other languages.

Given what you said about the API mutating, I am wondering if I should hold off. I can’t really get started until year-end. What I am doing now if for boards we have to design ASAP, so no time for that until all this work is done. Just thinking out loud.

EDIT: Also, it would be nice if schematic scripting was just as powerful.

The new api I mentioned is planned for both schematic and pcb. It is supposed to be in v7 (i.e. early next year) but it already slipped before and there is still nothing in the nightly so… ¯\_(ツ)_/¯

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.