A command-line tool that assists with managing KiCad part libraries
Project description
KiCad Symbol Tool
kicad-symbol-tool is a command-line tool that assists with managing KiCad part libraries.
Introduction
KiCad is an Electrical CAD tool that is used to design schematics and PCBs. A well-designed part will have:
- A proper graphical representation of the part and its pin numbers
- A link to the datasheet
- A link to the proper footprint
- Information on sourcing the part. This can be as basic as a manufacturer and manufacturer part number. Additionally, distributor information could be provided.
Unfortunately, it is laborious to define all this information in KiCad itself, as each part must be created and edited one at a time. This tool aims to remedy this. It is run by running the command:
kicad-lilbrary-manager <name of .kicad_sym library file>
It then performs the following:
- If the library doesn't exist, it throws an exception.
- If the library format is before 6.0, it throws an exception.
- If the file
<root name of .kicad_sym file>.xlsxdoes not exist, it will be created, and the utility will exit. - If it does exist, then if the
xlsxfile is newer than thekicad_symfile, the changes in thexlsxfile will be applied to the symbol's properties.
Template Parts
Each library should contain template parts. These parts will be used to derive new symbols. This is particularly useful for resistors and capacitors. These template parts should contain all of the properties that are desired on the derived parts. Note that while KiCad itself does not copy properties to directly derived parts, this tool explicitly copies the properties to the derived symbols. More than one template can exist in a library.
Generally, you don't want to instantiate these symbols. By convention, I precede the symbol name with a tilde ('~') and set the description to "Do not use - Template."
Format of xlsx file
The xlsx file will contain several tabs, one for each template part. Parts that are not derived will not be listed because it is assumed that the properties would have to be manually edited anyway. The data consists of one row for each part.
The following columns will always be present in the spreadsheet:
| Name | Description |
|---|---|
| Status | The status of updating the part from the spreadsheet. This can be "OK" (no error), "TemplateError" (the specified template doesn't exist), "PropWarning" (the property does not exist in the template and was ignored). |
| Name | The name of the symbol |
| Reference | Symbol reference designator letter(s) |
| Value | The value property (required) |
| Footprint | Symbol footprint (required) |
| Datasheet | Link to the datasheet |
| ki_keywords | Keywords used to search for parts |
| ki_description | Description of the part |
| ki_fp_filters | Filters used to select footprints |
Additional columns are the additional properties on the template part.
Installation Instructions
The tool can be run without installation using the Astral UV package manager.
Alternatively, the program is on PyPi under the name kicad-symbol-tool so it can be installed with pip or pipx.
Example Usage
Astral UV
If uv is installed, the program can be run by:
uvx kicad-symbol-tool <name of .kicad_sym file>
Pip or Pipx
kicad-symbol-tool <name of .kicad_sym file>
Supported KiCad Versions
The dependency is based on the symbol library file format. It has not changed since version 6.0, so it will work for any version greater than or equal to 6.0.
Contributing Guidelines
To be written...
License
The license is MIT.
Limitations and Future Work
To be written.
Implementation Notes
- The program will be written in Python.
- Astral
uvwill be used as the package manager. - Packages used:
Typerto implement the command-line program.sexpdatawill be used to parse the library file.- Unit tests will use
pytest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kicad_symbol_tool-1.0.1.tar.gz.
File metadata
- Download URL: kicad_symbol_tool-1.0.1.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
373a59939273fbd03c173eb5f6de7a0fa9e3e58197f6c790b35e4c0e3b57cd49
|
|
| MD5 |
1f8392b9f3704c7493043dd452e76c9d
|
|
| BLAKE2b-256 |
846702b69b5d751557292071686991da50e52cf6da725a843b00d4842fc6412b
|
File details
Details for the file kicad_symbol_tool-1.0.1-py3-none-any.whl.
File metadata
- Download URL: kicad_symbol_tool-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06d7d2f1ed7f48c7638258740f929e7f2956eb26280eac9e02a434057a1b29ed
|
|
| MD5 |
e5984b0028277115871a735062bbaef1
|
|
| BLAKE2b-256 |
16800700e6fa50cb76d72fd0bb9aa551550e9c3f65d544a9e0acfa395c4d9b98
|