Pilppa Kicad Lib DB Manager
Python tool for integrating the list of pcb components bought from PCB warehouses like Digikey and Mouser to Kicad.
This tool will work by parsing the CSV file of components that are ordered from warehouses like digikey or mouser. From digikey that file can be downloaed directly, while in mouser case you can download the excel file and then export that to CSV file with libraoffice or microsoft excel.
Data from imported CSV files are stored to sqlite3 database that can be then integrated to Kicad 8 library database.
This tool contains also the required pilppa_kicad_lib_db.kicad_dbl kicad configuration file which contains mapping instruction from database to sql.
Usage:
Following command will read csv file and append it content to sqlite database file pilppa_kicad_lib_db.sqlite. If database or Components table inside it does not exist, the tool will also create those automatically.
python ./pilppa_kicad_lib_db_manager.py -f component_orders/digikey/digikey_2024_03_01.csv
Usage Example With Kicad:
Following script will show how to import one digikey csv file and one mouser csv file to database and then integrate and use that from kicad 8.
- csv file import to new sqlite database:
./db_content_import_test.sh
- open database
sqlite3 test_sqlite3.db
- view component list from database
sqlite> select * from components;
will then so rows with following type of data in database table
1|HPH2-B-10-UA||||CONN HEADER VERT 10POS 1.27MM||||10|0.542||0 ...
- Install SQLITE odbc driver for your operating system. For ubuntu use command:
sudo apt-get install libsqliteodbc unixodbc
-
Create new kicad project kicad8_test
-
Copy sqlite database and configuration files under kicad8_test project
- cp pilppa_kicad_lib_db.kicad_dbl
- cp pilppa_kicad_lib_db.sqlite
- Open kicad project and configure driver
- Select Kicad Menu/Preferences/Configure Symbol Libraries
- Press + button
- Set name to "Pilppa"
- Set Library Format to Database
- Press browse button and select pilppa_kicad_lib_db.kicad_dbl
- Press ok to close the Symbol libraries dialog
- Test The component selection from the db library
- Open schematics with Kicad
- Press A button
- List of components will be showed
- Write 0402YC1 and component will be found from "Components/Pilppa category"
Additional Information
Configuring kicad 8 to use the library db