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-0.1.0.tar.gz (14.0 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-0.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for kicad_symbol_tool-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c8a4234dc9d21542fd1956cac1138cfd831db89d15ba4274418e4b43ed3bd13f
MD5 e514206345368b19033c456dfbc4c365
BLAKE2b-256 72c7f2dc255bb7a4d0e22457180485a09245c697a78e66703dd304e67143fec7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kicad_symbol_tool-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19fe81717a77f2725d698e754bc606b4728f7db9836218ddfdcb10bdc313e7d2
MD5 2a43e24bdd4b5a940be9d98b44d71cdb
BLAKE2b-256 4675d14d4986ae36a66c1ce2068151610618560712565e4017dd859040d41e82

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