Hello there,
I’d like to share a plugin I’ve developed for KiCad that integrates with a component database. As many of you may know, KiCad has supported the use of databases for managing component libraries since several versions ago, which offers greater flexibility and scalability for organizing parts.
However, maintaining this setup can be somewhat cumbersome. Specifically, working with a database-backed library involves managing two key files:
- The database file (
.db
), which stores all the component data. - The KiCad database link file (
.kicad_dbl
), which acts as a bridge between the database and KiCad’s internal library system.
The tedious part arises when you make structural changes to the database, such as adding a new table to accommodate additional component types or data. In such cases, you must manually update the .kicad_dbl
file to include the new table. Without this step, KiCad won’t recognize or access the new components you’ve added.
So, I decided to develop a Python script that automatically detects the database file (.db
) and generates the corresponding KiCad database link file (.kicad_dbl
) from it.
The Python script can be found on GitHub: link
I should mention that the main limitation of the Python script at this stage is related to the handling of database fields. Currently, the field mappings are hardcoded, so if your database uses different field names or custom fields, you’ll need to manually modify the relevant section of the script to reflect those changes, as illustrated in the image below:
If you’d like to see the script in action, I’ve created a demonstration video on my YouTube channel (https://youtu.be/XKC8Tgo5BJ8). The video is in Spanish, but English subtitles are available for non-Spanish speakers.