KiCad 9.0 Python API

@craftyjon Any idea of when you devs will enable the IPC API by default?

I’m 90% done with a new branch of Board2Pdf that uses IPC API (mostly cleaning left), but I don’t want to release it in PCM until the API is enabled by default, because I’m afraid that it will cause confusion and support issues.

I guess you mean the server setting? Not sure yet, maybe 9.0.1 but I haven’t looked at it yet. I wasn’t going to just enable it by default but instead add some kind of prompt to enable.

I guess I do, but just to be overly clear:

Ah, I see. Thanks for the info! Well, I guess that there’s no real rush. When I’m done with the new branch I’ll probably ask in this forum if anyone like to give it a try. And when it’s been at least somewhat tested and the server setting is enabled more intuitively I’ll release it in the PCM.

Now that V9 has been released, how does a beginner get started with the python API. Has the documentation been updated and is there a getting started guide? Or maybe a few tutorials? Thanks.

This is a good starting point:

From the page:
Automatically-generated documentation for kicad-python is available online at kicad-python documentation

There are some examples of scripts and plugins in the examples directory of the kicad-python repository that may be a good starting point for developing your own tools.

I went ahead and added something for tomorrow’s builds. You’ll need to add the optional entry "runtime": "ipc" to your version block in the plugin metadata.

Yeah, this is exactly what I see… I also tested this with the 9.0.0 release build on Windows 11. It isn’t really high priority for me at the moment to get the round track example working, but something seems to be off.

While this question was not directed to me, it was said that it will be finalized with version 10. Our plan for our addon was to release a secondary IPC version that will be merged into the main branch once the API is stable

Seems to work! I uninstalled 9.0.0 and deleted local settings, installed todays testing build, installed my plugin from PCM using a zip file, and got hit with this question:


After answering yes, the API was indeed enabled!

The plugin was installed in the correct place, but the PCB Editor fails to load it so I’ll have to debug that. When using swig based plugins it was easy to get the error messages from the failed loading in the properties, but it doesn’t seem to be possible with the ipc based plugins? Any chance this could be added?

image

There is no specific way that plugins can return ā€œerror messagesā€ to KiCad. You can enable the console trace output though if your plugin can print errors to stderr.

Yea, that’s pretty much my understanding as well. But unless you start using the IPC API, notice which features are missing for your use case and add feature requests, then it will probably never have all the needed features. And it will never be stable unless people start using it and finds its quirks and bugs.

Better to start early and help with the bug hunt! :slight_smile:

2 Likes

Agreed, I still want to port over our coil generator soon. Haven’t had the time though

1 Like

The API is already stable (meaning we are already following our stability practices when making changes during 9.0)

We will make the decision whether or not to completely remove the old SWIG support in V10 based on what we know about the new API’s ability to support people’s needs. If you wait until V10 to test whether or not the API meets your needs, and you happen to have a need that nobody else asked for earlier, you risk losing that ability until it can be re-added.

1 Like

Ah, I see…
I enabled the trace output for the API subsystem. The strange thing is that after I did that the plugin icon was loaded. :confused: But I found a few issues and it still works after removing the environment variables again.
Thank you!

So, I am just trying to create the schematic and layout using Skidl but it is not working for creating schematic so now I get to know about this API. So any one please tell me that this API can be used for the above thing I mentioned.

@devbisme is the developer and contributor here.

There is no API for schematics yet, new API (and old one) is pcb only for now.


The program freezes here

Thanks for the clarification qu1ck

Just wanted to make sure that my thank you post (Thank you. Thank you. Thank you) also reaches you directly :slight_smile: