How to export all components from schematic to a library

Hi All,
I’m very new to Kicad, I have just switched from Eagle Professional because of the recent license changes imposed by Autodesk. I’m very impressed so far.

When I create a final schematic, each component has an associated footprint, as well as supplier information in the attributes so that I can create a BOM straight from the schematic without having to hand-touch it after it’s generated. This is a workflow taken from Eagle, but I find it works even better in Kicad (great job BTW).

What I would like to do is to extract all of the components from a finished schematic, including footprint associations and attributes into a personal library, so that when I do another schematic, I can just choose a known component and drop it straight in. As I make more designs, I will continue to add to my personal library thus speeding up the design process.

Is this possible in Kicad?

The answer is that it is probably not done with KiCad itself.

Keep in mind that the Symbol Library and the Footprint Library are handled in different ways.

Eeschema creates a cache.lib file for the individual project; which is one file with all used symbols.

At the moment, I suggest that you look into a program called KiCad Librarian which can handle the symbol manipulation in different files. It is difficult to figure out how to set-up (at least it was for me).

The other option is to use a text editor and cut/paste the symbol information from the cache.lib file to a user create library file. This is not as easy to manage as figuring out how to use the KiCad Librarian though.

Thanks for the prompt reply. Kicad librarian looks good. Not quite what I’m after though.

Thank you. This is very useful. I can write a simple python script to extract the components and insert them in my own libraries.
I would like to alter $FPLIST to only contain the exact footprint which was chosen for that component. Do you know how Kicad stores the footprint relations?

You might want to do a forum search for Atomic Parts and KiField.

To answer this question directly, in Eeschema, hover over a symbol and hit “e” (or right click and select edit component/edit (if you are paying attention you may see the “F” option)).

The Field Name “Footprint” assigns the footprint to that symbol.

You could close out of that window and start by hovering over and hitting “Ctrl+e”. This will open the symbol editor in the current library. The top of the window should show Part Library Editor and the path of the current part.

If you already have assigned a footprint to the symbol, assign it a part number, change the “working library” and save to library AND then save to file. Must do both steps; save to library then save library to disk.

Next time you add the unique part number to Eeschama the footprint field will already be populated.

ON EDIT: I wrote this based on memory. I’ve just tested, and I have something wrong in the steps above.

Thank you for such a comprehensive answer. I did a search on Atomic Parts and KiField. I can see what you mean. This will make things very easy.

I can also understand your process for exporting individual from a schematic back to a library. Thanks for explaining.

I will probably automate the process to batch extract all components to my personal library after I have completed the schematic (because I’d get bored and make mistakes doing a manual extraction). I managed to locate a good reference on the file format here: https://www.compuphase.com/electronics/LibraryFileFormats.pdf.

Many thanks for your help. Have a great day.

Hopefully!

One more tidbit, in PcbNew, realize that there are 3 current canvases supported.

Hit F11 to select the OGL canvas, then find the “routing” menu for the interactive router. Play with that for a short while, and your hate for the library system in KiCad might not seem so important anymore.

Thanks. I’ll try it.

I actually find the KiCad Library system pretty good. It’s better than the one Eagle uses.

Hi - I’m wondering whether progress has been made on this. In my previous workflow (Pulsonix) it was easy to create a complete set of libraries (symbols, footprints, etc) from a finished design. This allows me to take a finished design and create an archive containing everything required to reproduce or edit the design in the future, or to deliver the archive to a customer.

If a tool exists to do this, I’d really like to know about it. If one does not exist but someone is working on it, I’d like to participate.

For archiving simply also include the cache lib then the project is standalone (worst case you get the rescue dialog when opening the project without the same libraries setup)
Layout side is already standalone anyways as all footprints are included in the pcb file (the same will be done for symbols in the next release)

You can try using Archive project action plugin. Though saving worksheet is still missing.

There is a Hack a Day article from 2017 that covers how to set up libraries for easy archiving and sharing. It shows where the all the symbols are kept locally and how to save all the footprints to a local folder removing the dependency on the shared libraries. It does not require a plug in or third party software. I wish there was an updated article for the new version of KiCad.

Hack a Day article: KICAD BEST PRACTICES: LIBRARY MANAGEMENT

There’s no link, only text.

You don’t actually give the link to the Hack a Day article (and I’m too lazy to look it up). But, our head (volunteer) librarian has done a good job with the following FAQ entry that gives a suggestion for configuring libraries in addition to explaining in detail how KiCad organizes and access libraries:

1 Like

There is also the archive project action plugin by @MitjaN


To be honest my FAQ article is biased against using local libraries as i deem them not really scalable. Using them creates a mess for everyone who wants to make more than a few boards a year. So it is possibly not really the correct read for people who do not care about having a well organized central library.

I personally would provide personal libs separately in the same version control repo or as for example a separate repo included via a git submodule. These global libs would have a unique prefix (something representing my organization) to reduce the risk of naming conflicts.
Anyone who wants to view my project does not really need to care about my lib setup anyway (footprints are embedded and symbols are in the cache lib so the rescue dialog will take care of them)
Anyone who collaborates with me should not only take care to correctly handle my project but also my libraries. (Meaning they need to once add the used personal libs to their kicad setup.) This would be easier if kicad would support multiple global library tables or at least a import of a partial library table.

And yes i know that the usecase of just copying stuff together from different open hardware projects is a bit harder this way. But i think there the user would be well advised to incorporate externally sourced symbols, footprints and 3d models into their library setup and reconnect them inside the project (might even want to adapt the symbols and footprint to once personal standard and manufacturing capabilities)

1 Like

That Hackaday article boldly claimed to be “best practices” but actually was just one person’s view, and I didn’t agree with it much.

Not sure why we are reviving this old thread anyway…

At least the issue of public shared projects is still worth discussing. KiCad doesn’t have an answer for that.

Elsewhere I suggested that KiCad would need complex library management where each project could have local libraries but those libraries could be synced with external (global) libraries and vice versa, either automatically or at will. That could probably be a 3rd party application, at least partially.

But the current state of affairs is that if you want to share a project which is meant to be continued by more than just the original developer it’s very painful.

Agreed, but I don’t think anything in KiCad has changed much over the 2 years since the OP posted.

In normal industry practice, compatibility issues tend to be addressed by having a master config which is pushed to all clients. That is something that IT can do. The master config is approved by a single Design Authority.

I’m not sure that any project has really “solved” configuration control for distributed development.

We might need to differentiate what we are talking about. I see at least two different meanings of the word sharing. One is within an organization (example a company) and one is “with the world”.

The former is quite well supported by kicad. For it the best option is to have a global library setup and strict control over what is added to it. This global lib is then added to every users setup at the beginning (and new libs will need to be added on the fly -> some way of notifying users of a added lib might be useful. Or having the lib tables somewhere central.)


The second usecase is a bit tricky. But i would not suggest the use of project local libs (as should be clear from my above post). And to be honest this usecase will always be tricky as it kind of clashes with the first (arguable more important usecase for a tool aiming for adaptation in the professional world).
It would require an easy way to decentralize ones library setup or acceptance that any project is atomic and reusability is limited. (There is a tradeoff between having a clean well organized library and having the option to simply use any external asset on the fly)

A good help would be the option to have an unlimited number of library tables (libraries of libraries) that all can include libraries relative to the lib table location. This would allow a user to include many different externally managed “global” libraries.


By the way from using both kicad and eagle i would say kicad is better for the strict centralized workflow and eagle is better for the decentralized libs live anywhere workflow.