KiCad Component Database (In Progress)
Created: October 28, 2026
Background
KiCad is an open-source EDA tool for making printed circuit boards (PCBs). The tool itself is really excellent especially considering it is free. It runs and feels both lightweight and smooth. However, there is one part of it that has always bugged me and that is how parts are selected. With KiCad you have your schematic symbol and your layout footprint. The footprint is assigned to the symbol if it doesn’t already have one linked. For instance, you might plot down a resistor into your schematic, but then you have to pick what footprint you want to use. Not all parts in KiCad are like this in fact, most have footprints assigned to the symbol by default. What I don’t like about this is that you have such a wide variety of parts to choose from it can become overwhelming. Plus, it would be nice to have your own library of parts to select from.
I use Altium professionally and one thing I really like about it is its component database (not the manufacturer part search). Having a custom set of parts to use is nice for many reasons. First, you get to pull as much or as little as information into that database. Second, you get to decide on how you want the information displayed, which helps with organization. Third, it forces you to use parts that you have hand-selected rather than just grabbing from the default library.
I have been wanting to make some more PCBs at home, so I decided to see if KiCad supports a database library like Altium. To my surprise it does! In fact, there are two different ways to host the database. The first way is through a .kicad_dbl file and the second is through a .kicad_httplib file. The former requires knowledge of setting up and hosting the database (which I have no experience with), and the latter requires hosting a simple web server (which I do have some experience with). Since I do not have knowledge of setting up and hosting a database, I will go the HTTP server route.
I knew that I would want to store my component library in a CSV file. This would allow me to either manually edit it or open it in an application such as Excel or LibreOffice.
Currently only REST or REST-like API are supported. KiCad has documentation, here, providing what the application sends out in the form of HTTP GET requests and what it expects back in the form of HTTP OK responses. KiCad expects JSON responses with strings only.
So far I know I need to be able to read and parse CSV file, receive HTTP requests, and respond with JSON key-value pairs. This means I’m going to need a script that will be able to do all of this. My scripting language of choice is Perl.
Creating the Database
There are a few things I need to do before I integrate everything with KiCad. I need a way to manage the database without having to open an Excel sheet all the time. One way around this is to create a script that allows me to perform database-like functions, such as, adding, removing, and displaying parts.
I figure I could create a command-line interface tool (CLI) that mimics the sub-commands of git. Doing so would allow me to issue commands like <script> add to add a component or <script> remove to delete a component. Starting off I do not need that many commands.
The script will also need to create a new or load an existing database. Again, I will just use raw CSV files for this so that they are human-readable. Perl makes this rather easy.
Next, I need to figure out what component information I actually need to store.
Component Information
Manufacturers list a ton of different component information, which is not always needed by the designer or librarian. However, the EDA tools will need specific part information in order to be able to use the part (schematic symbol, footprint, reference designator, etc.).
Also, it can be beneficial to create your own custom part numbering for your company or organization. Instead of using the manufacturer’s part number (MPN) to refer to parts you can use your own system. It really helps with organization.
Anyway, here is a simple list of component information that I want to keep track of. Of course, this can be expanded in the future.
- Custom ID
- Reference Designator
- Component Name
- Description
- Symbol
- Footprint
- Manufacturer's Part Number
- Manufacturer
- Datasheet
KiCad cares about all of this and has some nice features, like automatically pulling up the linked datasheet when pressing D hotkey. I will create a custom symbol and footprint library for all of the parts I create.
Custom Part Numbers
Like I previously mentioned, it can be beneficial to create your own part numbering system. I plan on using a XX-YYYYYY system where XX is the component category and YYYYYY is the index number of the part. Here is the list of component categories and their associated numeric prefix that I came up with.
| Numeric Prefix | Category Description |
| -------------- | ------------------------------------------------ |
| 00 | Print Circuit Boards |
| 01 | Resistors |
| 02 | Capacitors |
| 03 | Inductors |
| 04 | Diodes |
| 05 | Transistors & Discrete Semiconductors |
| 06 | Optoelectronics |
| 07 | Integrated Circuits (ICs) - Analog & Power |
| 08 | Integrated Circuits (ICs) - Digital & Processing |
| 09 | Connectors & Headers |
| 10 | Crystals, Oscillators, & Resonators |
| 11 | Protection Devices |
| 12 | Switches & Relays |
| 13 | Sensors & Transducers |
| 14 | RF & Microwave |
| 15 | Hardware & Mechanical |
| 99 | Modules & Sub-Assemblies |
For example, the first resistor in my component database will be 01-000000.
Future Work
Here is a TODO list of what still needs to be done for this to be a completed project:
- [ ] Build out database features
- [ ] Create custom KiCad symbol and footprint libraries
- [ ] Integrate with KiCad
- [ ] Deploy server on machine
- [ ] Update blog