Skip to main content

JLC2KiCad_lib is a python script that generate a component library (symbol, footprint and 3D model) for KiCad from the JLCPCB/easyEDA library.

Project description

JLC2KiCadLib

PyPI version Python versions Downloads Code style: black License: MIT

JLC2KiCadLib is a python script that generate a component library (symbol, footprint and 3D model) for KiCad from the JLCPCB/easyEDA library. This script requires Python 3.6 or higher.

Example

easyEDA origin KiCad result
JLCSymbol KiCadSymbol
JLCFootprint KiCadFootprint
JLC3Dmodel KiCad3Dmodel

Installation

Install using pip:

pip install JLC2KiCadLib

Install from source:

git clone https://github.com/TousstNicolas/JLC2KiCad_lib.git
cd JLC2KiCad_lib 
pip install . 

Usage

usage: JLC2KiCadLib [-h] [-dir OUTPUT_DIR] [--no_footprint] [--no_symbol] [-symbol_lib SYMBOL_LIB] [-footprint_lib FOOTPRINT_LIB]
                    [-models [{STEP,WRL} ...]] [--skip_existing] [-model_base_variable MODEL_BASE_VARIABLE]
                    [-logging_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--log_file] [--version]
                    JLCPCB_part_# [JLCPCB_part_# ...]

take a JLCPCB part # and create the according component's kicad's library

positional arguments:
  JLCPCB_part_#         list of JLCPCB part # from the components you want to create

options:
  -h, --help            show this help message and exit
  -dir OUTPUT_DIR       base directory for output library files
  --no_footprint        use --no_footprint if you do not want to create the footprint
  --no_symbol           use --no_symbol if you do not want to create the symbol
  -symbol_lib SYMBOL_LIB
                        set symbol library name, default is "default_lib"
  -symbol_lib_dir SYMBOL_LIB_DIR
                        Set symbol library path, default is "symbol" (relative to OUTPUT_DIR)
  -footprint_lib FOOTPRINT_LIB
                        set footprint library name, default is "footprint"
  -models [{STEP,WRL} ...]
                        Select the 3D model you want to use. Default is STEP. 
                        If both are selected, only the STEP model will be added to the footprint (the WRL model will still be generated alongside the STEP model). 
                        If you do not want any model to be generated, use the --models without arguments
  -model_dir MODEL_DIR  Set directory for storing 3d models, default is "packages3d" (relative to FOOTPRINT_LIB)
  --skip_existing       use --skip_existing if you want do not want to replace already existing footprints and symbols
  -model_base_variable MODEL_BASE_VARIABLE
                        use -model_base_variable if you want to specify the base path of the 3D model using a path variable
  -logging_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        set logging level. If DEBUG is used, the debug logs are only written in the log file if the option --log_file is set
  --log_file            use --log_file if you want logs to be written in a file
  --version             Print versin number and exit

exemple use : 
        JLC2KiCadLib C1337258 C24112 -dir My_lib -symbol_lib My_Symbol_lib --no_footprint

The only required arguments are the JLCPCP_part number (e.g. Cxxxxx)

Example usage :

JLC2KiCadLib C1337258 C24112 -dir My_lib                       \
                             -model_dir My_model_dir           \
                             -footprint_lib My_footprint_lib   \
                             -symbol_lib_dir My_symbol_lib_dir \
                             -symbol_lib My_symbol_lib

This example will create the symbol, footprint and 3D model for the two components specified and will output the symbol in the ./My_lib/symbol/My_symbol_lib.lib file, the footprint and 3D model will be created in the ./My_lib/Footprint. This will result in the following tree to be created :

My_lib
├── My_footprint_lib
│   ├── My_model_dir
│   │   ├── QFN-24_L4.0-W4.0-P0.50-BL-EP2.7.step
│   │   └── VQFN-48_L7.0-W7.0-P0.50-BL-EP5.5.step
│   ├── QFN-24_L4.0-W4.0-P0.50-BL-EP2.7.kicad_mod
│   └── VQFN-48_L7.0-W7.0-P0.50-BL-EP5.5.kicad_mod
└── My_symbol_lib_dir
    └── My_symbol_lib.kicad_sym

Most of those arguments are optional. The only required argument is the JLCPCB part #.

The JLCPCB part # is found in the part info section of every component in the JLCPCB part library.

By default, the library folder will be created in the execution directory. You can specify an absolute path with the -dir option.

Dependencies

JLC2KiCadLib relies on the KicadModTree framework to generate the footprints.

Notes

  • Even so I tested the script on a lot of components, be careful and always check the output footprint and symbol.
  • I consider this project completed. I will continue to maintain it if a bug report is filed, but I will not develop new functionality in the near future. If you feel that an important feature is missing, please open an issue to discuss it, then you can fork this project with a new branch before submitting a PR.

License

Copyright © 2021 TousstNicolas

The code is released under the MIT license

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

jlc2kicadlib-1.0.32.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

JLC2KiCadLib-1.0.32-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file jlc2kicadlib-1.0.32.tar.gz.

File metadata

  • Download URL: jlc2kicadlib-1.0.32.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.6

File hashes

Hashes for jlc2kicadlib-1.0.32.tar.gz
Algorithm Hash digest
SHA256 ef9c51b3f612a5e055f356b19b657a94dc907d8c67708ebb976d698defa06448
MD5 e66f95b91037610495e5e396a6dcacfc
BLAKE2b-256 f07da26085e59304c8aab0aedf88ad90c48c0647d91d9c5e5012f4cceb14b380

See more details on using hashes here.

File details

Details for the file JLC2KiCadLib-1.0.32-py3-none-any.whl.

File metadata

File hashes

Hashes for JLC2KiCadLib-1.0.32-py3-none-any.whl
Algorithm Hash digest
SHA256 66ca4840b52f60d03d1f0e54ecc8ca9ff9284b39f6673b9b6cce4444581cd257
MD5 5a15d65a36d1b48f47e2183436b92e19
BLAKE2b-256 26a4b94b5050867c5cf1db7691fc96c3a22178027ce96629c7b185820b916581

See more details on using hashes here.

Supported by

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