Skip to main content

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>.xlsx does not exist, it will be created, and the utility will exit.
  • If it does exist, then if the xlsx file is newer than the kicad_sym file, the changes in the xlsx file 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 uv will be used as the package manager.
  • Packages used:
    • Typer to implement the command-line program.
    • sexpdata will 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

kicad_symbol_tool-1.0.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kicad_symbol_tool-1.0.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file kicad_symbol_tool-1.0.0.tar.gz.

File metadata

  • Download URL: kicad_symbol_tool-1.0.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for kicad_symbol_tool-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e999e41152b810ff6af95a4743b37e77208275c8b6244409395f442c15b2bd01
MD5 c07b852ab3b8c67dc789ae469a23e63c
BLAKE2b-256 55bcb1fb96a877a6b9e5d891a482b7d1122a9d70e27d42631b1829686a87b799

See more details on using hashes here.

File details

Details for the file kicad_symbol_tool-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for kicad_symbol_tool-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f6b5237a48601d420fa4a538d9453998987972f0562c6e6b62b5c28fd3bf3620
MD5 13d6bacf9c01bfa6052f5d9db1aad7dd
BLAKE2b-256 cabf29200993f5237a216b9ea313a799ce4cc0dbbab6bcf090a2c762458233a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page