Skip to content

A CLI that automatically imports external components into a KiCad project.

License

Notifications You must be signed in to change notification settings

HarveyBates/kandle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kandle (KiCAD Component Handler)

What is it?

A CLI that handles external components in a KiCad project by automatically importing them into your project symbol, footprint and 3d-model libraries.

It supports files downloaded from several vendors such as:

The CLI will:

  • Handle the unzipping of files downloaded from the above providers.
  • Place symbols, footprints and models in a defined directory structure.
  • Convert KiCad v4 symbols (.lib files) to KiCad v6 symbols (.kicad_sym files).
  • Link a symbol and footprint automatically.
  • Automatically import the symbol *if a symbol library for that component exists (same goes for the footprint)

See it in action here

Video

Or see an example project.

Installation

Download repository

git clone https://github.com/HarveyBates/kandle
cd kandle
mkdir build
cd build
cmake ..
make
make install # (optional, if not you need to add kandle/build/bin to your path)

If you want to permanently add the script to your path here is a tutorial.

Usage

Step 1

In your terminal navigate to your KiCAD project. You want to be in the same directory as your .kicad_pro file. If not you will get an error message saying "KiCad project not found in current working directory. Exiting.".

Step 2

Setup (initialise) the directory structure.

kandle -I

This will result in a directory structure like this:

your_kicad_project/
├─ components/
│  ├─ extern/
│  │  ├─ 3dmodels/
│  │  ├─ footprints/
│  │  ├─ symbols/
│  │  ├─ tmp/ <--- unzipped files will be stored here
├─ fp-info-table
├─ sym-info-table
├─ project.kicad_pcb
├─ project.kicad_pro
├─ project.kicad_sch

Step 3

Download a component from the supported vendors (as above). There is no need to rename the .zip file, unless you would like a alternative name. Kandle will remove "ul_" (from Ultra-Librarian) and "LIB_" (from CSE). It will also replace all - or spaces with _.

Example: If the filename is LIB_PESD 0402-140.zip it will become PESD_0402_140.

Step 4

Execute kandle passing the file you just downloaded and the library the part belongs to.

Example: If the part is an operational amplifier called LM358 stored in your Downloads directory. Your command would look like this: kandle -f Downloads/LM358.zip -l operational_amplifier

kandle -f <your_download_file_name>.zip -l <library_name>

Step 5

Open Eeschema -> Preferences -> Manage Symbol Libraries -> Project Specific Libraries -> Add existing.

Using the above example, you would import the file components/extern/symbols/operational_amplifier.kicad_sym.

Step 6

Open PCBnew -> Preferences -> Manage Footprint Libraries -> Add existing.

Using the above example, you would import the file components/extern/footprints/operational_amplifier.pretty.

Attention Kandle will automatically change default text size of footprint names to 1 with a thickness of 0.15 (KiCAD defaults).

Step 7

Place on your Eeschema schematic. In the above example, you would search for operational_amplifier and then select LM358. The symbol should already be linked to the footprint.

All future symbols and footprints of type operational_amplifier will appear automatically so there is no need to repeat Step 5 again!

Help

KiCAD 3rd Party Component Management Tool
Usage:
  kandle [OPTION...]

  -I, --init          Initialise a KiCAD project with Kandle.
  -L, --list          List existing component libraries.
  -f, --filename arg  Path to zipped (.zip) component file.
  -l, --library arg   Name of the library the component belongs to.
  -h, --help          Help information.

Found a problem

Submit an issue with:

  1. A link to the component (if the issue is related to a component you are trying to import).
  2. A description of the issue that you are facing.

License

This project is MIT licensed, as found in the LICENCE file.