KiCAD Mouser & Digikey integration

I want to create a plugin for the KiCAD EESchema editor that would allow opening an integrated store (like Mouser or Digi-Key, LCSC & etc.) directly inside the program, searching for a component there, and importing its Name, Datasheet, Description, Mfr. No., and Manufacturer into the Symbol Fields. That way, the only remaining step would be to generate a BOM file and place an order.
The problem appeared at the stage of connecting these two programs. At first, I thought about making the interface in Python, but from what I’ve found, EESchema in KiCAD does not support plugin integration directly. The only option left seems to be editing the source code and compiling it myself.

I found the file kicad-source-mirror/eeschema/dialogs/dialog_symbol_properties.cpp, and as far as I understand, this is the file responsible for rendering the window where I need to add one button and a function that would receive the exported Attribute Search values of the selected component from my program.

However, I can’t compile it, because as soon as I include a single header file through CMake, a bunch of other dependencies show up, and some header files are also missing, which only exist during the full project build. In the end, I realized that I need to compile the entire project — but the problem is that it takes a very long time.

Does anyone have an idea how to make a test dialog window (dialog_symbol_properties) so that it can be debugged easily, and eventually, once everything is ready, I could just copy the code into the full KiCAD project?


1 Like

Are you aware of KiCost?

It is/was a plugin (or standalone script?) that could pull cost and other data from various sources. As far as I know the manufacturers use various methods to block such automated approaches. I never used it myself, but maybe it’s useful for you to have a look at that source code.

Edit: I assumed that just mentioning the magic name was enough of a hint to start a search such as:

https://forum.kicad.info/search?q=KiCost

And finding things like:

2 Likes

I think it was @devbisme that started KiCost and stopped when they started demanding accounts/keys/whatever to do this? I think someone picked it up but I’m not sure.

How about creating a plugin for pcbnew?
All you need to do is create a GUI that lists existing BOMs in a table and processes only specific columns, then either revert to the original or output a different BOM when you’re done.