Easyeda2kicad.py - Convert any LCSC components (including EasyEDA) to KiCad library

Overview

easyeda2kicad.py

A Python script that convert any electronic components from LCSC or EasyEDA to a Kicad library

Installation

git clone https://github.com/uPesy/easyeda2kicad.py.git
cd easyeda2kicad.py/
pip install requirements.txt

The script uses only one external library pydantic for data validation.

Usage

All librairies are saved in easyeda2kicad.py/output_lib :

  • easyeda2kicad.lib for symbol library
  • easyeda2kicad.pretty/ for footprint library

Cli usage :

# For symbol + footprint
python easyeda2kicad.py --symbol --footprint --lcsc_id=C2040
# For symbol only
python easyeda2kicad.py --symbol --lcsc_id=C2040
# For footprint only
python easyeda2kicad.py --footprint --lcsc_id=C2040

Add libraries in Kicad

Before configuring KiCad, run at least once time the script to create lib files

  • In KiCad, Go to Preferences > Configure Paths, and add the environment variables EASYEDA2KICAD : path/to/easyeda2kicad.py/ouput_lib
  • Go to Preferences > Manage Symbol Libraries, and Add the global library easyeda2kicad : ${EASYEDA2KICAD}/easyeda2kicad.lib
  • Go to Preferences > Manage Footprint Libraries, and Add the global library easyeda2kicad : ${EASYEDA2KICAD}/easyeda2kicad.pretty
  • Enjoy πŸ˜‰

Notes

It's still in development : all features are not implemented. I'm not a Python expert and don't have a lot of free time for coding.
I need your help to improve the code base architecture, adding unit tests and adding in the pip repo
Feel free to contribute on the dev branch πŸ™‚

Some stuffs to be done:

  • Improve the readme
  • Refactoring the code
  • Add unit testing and code coverage badge
  • Adding in the Python repo to install it with pip
  • Call the script directly from the terminal without using python easyeda2kicad.py
Comments
  • Feature request: Add GUI

    Feature request: Add GUI

    I love this plugin but it feels not really integrated. I think a GUI woud be absolutely awesome!

    It could be super simple, maybe just a single window that shows up after the user clicks the action plugin button. There you got the options (checkboxes, radios, whatever) and paths which could be saved in a YAML/TOMS/INI file beside the plugin itself. And a textfield for the LCSC number plus a Go button to download the data.

    Actually not that big of a deal to build and would make the plugin usable from within KiCAD.

    enhancement help wanted Stale 
    opened by Bouni 18
  • Add support for circles and arcs in symbols

    Add support for circles and arcs in symbols

    By now circles and arcs are not supported which leads to wierd symbles sometimes, here's nan example for C318884

    Easyeda symbol: image

    KiCAD symbol generated by this tool: image

    According to the code, circles and arcs are not yet implemented:

    https://github.com/uPesy/easyeda2kicad.py/blob/6ac7bae3363c5a5cd185f7e55c24cc9e2b117bbe/easyeda2kicad/easyeda/parameters_easyeda.py#L143-L152

    The code even states that arcs are not supported by KiCAD but thats not true for V6.0 / V6.99 (elliptical arcs are not supported, thats true)

    https://github.com/uPesy/easyeda2kicad.py/blob/6ac7bae3363c5a5cd185f7e55c24cc9e2b117bbe/easyeda2kicad/easyeda/easyeda_importer.py#L64-L72

    bug enhancement 
    opened by Bouni 13
  • Minor symbol issues and 3D model offset [LCSC C393942]

    Minor symbol issues and 3D model offset [LCSC C393942]

    Hi,

    first of all, wonderful tool 🀩

    Added this switch: grafik

    Thats the result in the Schematic: grafik

    This is what esyEDA gives me: grafik

    The footprint looks good apart from minor artifacts: grafik

    The 3D model is offset in Y and Z: grafik

    bug 
    opened by Bouni 12
  • Feature request: Add shortcut for easyeda2kicad command

    Feature request: Add shortcut for easyeda2kicad command

    Maybe im just lazy but if possible it would be nice to have a shortcut for the easyeda2kicad command, e2a for example.

    I'm not sure but I think that should be possible in the setup.py like this:

    entry_points={"console_scripts": [
       "easyeda2kicad = easyeda2kicad.__main__:main",
       "e2a= easyeda2kicad.__main__:main"
    ]},
    
    enhancement Stale 
    opened by Bouni 9
  • Parse error with .kicad_sym in Kicad6

    Parse error with .kicad_sym in Kicad6

    First of all thanks for this awesome program!

    I got a parse issue with kicad6 loading the .kicad_sym file.

    I did:

    easyeda2kicad --full --lcsc_id=C2040 --output ./C2040
    

    It generated the following .kicad_sym

    (kicad_symbol_lib
      (version 20211014)
      (generator https://github.com/uPesy/easyeda2kicad.py
      (symbol "RP2040"
    

    There seems to be an issue with no ')' at the end of the generator line. Adding that seemed to fix the parse error in kicad for me

    opened by anfractuosity 9
  • Save as .kicad_sym (instead of legacy format) & add more details In symbol?

    Save as .kicad_sym (instead of legacy format) & add more details In symbol?

    Is there a way to directly write a .kicad_sym file, so it can be edited in KiCad 6? Also, would be super useful to have more details from the web page available in the symbols - LCSC ID, description, datasheet, package, and price per unit are the most important which I have always added manually so far.

    enhancement 
    opened by glowingkitty 8
  • overwriting over 20 symbols on one file causes kicad to fail to load

    overwriting over 20 symbols on one file causes kicad to fail to load

    expected behaviour

    converted symbols are visible on kicad

    what actually happened

    symbols fails to load when exeed 20 on a single file

    how to reproduce

    add 20 symbols with command with --overwrite option

    how to go around

    write to other file via --output option

    opened by wb1016 6
  • Feature request : Automatically add library path to Kicad in first run

    Feature request : Automatically add library path to Kicad in first run

    All these manual steps can be done automatically https://github.com/uPesy/easyeda2kicad.py#-add-libraries-in-kicad

    Suggestion by @Bouni : https://gist.github.com/Bouni/cf1e5fde1d35ddd71f98d12781353897

    enhancement Stale 
    opened by uPesy 6
  • Feature request: Allow users to set a default output path

    Feature request: Allow users to set a default output path

    It would be nice if there would be some sort of config somewhere so that a user could specify a default output path (and maybe other default values as well)

    enhancement Stale 
    opened by Bouni 6
  • Symbol and 3D model broken in 0.3.1

    Symbol and 3D model broken in 0.3.1

    I've just updated to 0.3.1 and it seems that the symbol (new .kicad_sym) as well as the 3D Model do no longer work!

    6.0.5 and 6.99 (latest nightly) both do not show a symbol nor the 3D Model but the fotprint is working. I tested with C2040 as it is known to be working.

    I found out that there is a Bracket to much, if I delete that it works.

    (kicad_symbol_lib
      (version 20211014)
      (generator https://github.com/uPesy/easyeda2kicad.py)
    ) <--- This Bracket is to much !!
      (symbol "RP2040"
    

    Why the .wrl file is not working is still unclear ...

    opened by Bouni 6
  • Offset issue for 3D Model

    Offset issue for 3D Model

    Hi, I have not find the way to convert the offset of easyeda 3d model to KiCad 5.x

    For exemple for ID C319148, here the JSON with only relevant data

    "dataStr": {
                    "head": {
                        "x": 4001.992,    // x origin footprint
                        "y": 2999.8101,  // y origin footprint
                    },
                    "canvas": "CA~1000~1000~#000000~yes~#FFFFFF~10~1000~1000~line~0.03937~mm~1~45~visible~0.5~4001.992~2999.8101~0~none",
                    "shape": [
                        "SVGNODE~{\"gId\":\"g1_outline\",\"nodeName\":\"g\",\"nodeType\":1,\"layerid\":\"19\",\"attrs\":{\"c_width\":\"35.19678\",\"c_height\":\"31.1023\",\"c_rotation\":\"0,0,180\",\"z\":\"-3.5433\",\"c_origin\":\"4001.992,3004.2501\",\"uuid\":\"c50ce21ae3b941ce8eeb9bccc6cdef41\",\"c_etype\":\"outline3D\",\"id\":\"g1_outline\",\"title\":\"USB-3.1-SMD_16P-L8.9-W7.3-H3.3-P0.5\",\"layerid\":\"19\",\"transform\":\"scale(1) translate(0, 0)\"},\"childNodes\":[{\"gId\":\"g1_outline_line0\",\"nodeName\":\"polyline\",\"nodeType\":1,\"attrs\":{\"fill\":\"none\",\"id\":\"g1_outline_line0\",\"c_shapetype\":\"line\",\"points\":\""}}]}"
                    ],
    
    bug help wanted Stale 
    opened by uPesy 6
  • Minor issue with through hole pads

    Minor issue with through hole pads

    I've downloaded C77837, a D-SUB connector. The holes look like they are filled with copper:

    grafik

    But wehn I open them in the editor, change the type from THT to SMD and back, they appear right.

    On closer inspection I've seen that they all have *.Paste in their layers, bcause the part is set to SMD:

    grafik

    But changing that to THT doesn't solve the issue, I've to remove the *.Paste from every pad in a texte ditor:

      (pad "" thru_hole circle (at -16.53 0) (size 4 4) (drill 3.3) (layers *.Cu *.Mask) (tstamp a98297e3-cdc7-4872-ad2f-4ada1c6ce0e9))
      (pad "" thru_hole circle (at 16.79 0) (size 4 4) (drill 3.3) (layers *.Cu *.Mask) (tstamp 2b1a6742-90de-45cd-acf2-2c3211d682ea))
      (pad "1" thru_hole circle (at 9.73 -1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp 6a7ed235-d9c5-4d2b-bade-77126e580c77))
      (pad "2" thru_hole circle (at 6.95 -1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp df04db4d-e4a9-4cf8-844d-f61d545a4416))
      (pad "3" thru_hole circle (at 4.17 -1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp ddf7d6f8-48ad-42cd-b128-d7fb18c1a735))
      (pad "4" thru_hole circle (at 1.39 -1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp 3af50f33-530e-4e89-935c-a083c9a4c41f))
      (pad "5" thru_hole circle (at -1.39 -1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp 4cc5cb1d-adc3-464c-8d52-fbe477e18693))
      (pad "6" thru_hole circle (at -4.17 -1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp bdc8f212-b8a7-4082-ad82-0a85f5085f2d))
      (pad "7" thru_hole circle (at -6.95 -1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp 2a332a1d-289b-4303-8172-b62883e267d8))
      (pad "8" thru_hole circle (at -9.73 -1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp 1071132d-245e-4980-950c-3c2fa136c68b))
      (pad "9" thru_hole circle (at 8.34 1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp fdd17afd-52cc-463b-bd25-57d4e67b9840))
      (pad "10" thru_hole circle (at 5.56 1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp 95192e95-2a70-49e9-a255-5ac9b614511b))
      (pad "11" thru_hole circle (at 2.78 1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp f3f6d7a7-6dd8-456b-8607-c05a3ca4af77))
      (pad "12" thru_hole circle (at 0 1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp 0227ef85-4dd4-41ca-a192-87bdc7fb9ca8))
      (pad "13" thru_hole circle (at -2.78 1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp 09cc6263-b3ee-43c3-9d0b-b9d54dc804ab))
      (pad "14" thru_hole circle (at -5.56 1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp c7942b37-e066-4353-a2bd-5cf3df2bb8dc))
      (pad "15" thru_hole circle (at -8.34 1.42 180) (size 1.8 1.8) (drill 1.199896) (layers *.Cu *.Mask) (tstamp f0220c46-fb05-47b0-8264-869ddd6623e9))
    

    This solves the issue but is very labor intensive ...

    grafik

    opened by Bouni 0
  • installing through windows doesnt work

    installing through windows doesnt work

    after installing the package, running easyeda2kicad returns "easyeda2kicad : The term 'easyeda2kicad' is not recognized as the name of a cmdlet, function, script file, or operable program."

    opened by Cowh3adDK 1
  • Fails to import

    Fails to import

    Suddenly(as in this morning), after importing numerous symbols into easyeda2kicad.kicad_sym, any further imports the program completes without errors, yet no symbol is actually populated in the kicad_sym file. Any ideas why?

    opened by fpovoski 2
  • C398355 - fails to import symbol

    C398355 - fails to import symbol

    C398355 is a dual opamp, its symbol on easyeada comes in two(?) parts, the import basically imports an empty symbol.

    There is a version of the chip in kicad, there you have to add three symbols and end up with more than one footpriunt that needs to be aligned. Both versions are not nice :)

    opened by bzed 5
  • Added relative path option for 3D-Files

    Added relative path option for 3D-Files

    Hi There

    I have added a new flag for the commandline. It enables you to store the 3D-File relative to the project folder.

    In fact it opens all kicad_mod files and changes the absolute path to a relative one. For example:

    (model "${KIPRJMOD}/test.3dshapes/LED0603-R-RD_BLUE.wrl"

    ${KIPRJMOD} is the path of the project.

    Would be nice, if you accept the pull request :)

    Stale 
    opened by swissbyte 4
Releases(v0.1.0)
Owner
uPesy Electronics
Maker who creates ESP32 development boards, electronic modules for others makers.
uPesy Electronics
An open source two key macro-pad modeled to look like a cartoony melting popsicle

macropopsicle An open source two key macro-pad modeled to look like a cartoony melting popsicle. Build instructions Parts List -1x Top case half (3D p

17 Aug 18, 2022
PBA: Pleco Breeding Assistant

A small monitor that reports the external, fishroom and water change parameters to have suitable water parameters and induce breeding. These two features already represent 50% of the "reproductive su

Mirko Mancin 1 Jan 19, 2022
Component for deep integration LedFx from Home Assistant.

LedFX for Home Assistant Component for deep integration LedFx from Home Assistant. Table of Contents FAQ Install Config Performance FAQ Q. What versio

Dmitry Mamontov 28 Dec 13, 2022
Hook and simulate global keyboard events on Windows and Linux.

keyboard Take full control of your keyboard with this small Python library. Hook global events, register hotkeys, simulate key presses and much more.

BoppreH 3.2k Dec 30, 2022
πŸ±πŸ–¨Cat printer is a portable thermal printer sold on AliExpress for around $20.

Cat printer is a portable thermal printer sold on AliExpress for around $20. This repository contains Python code for talking to the cat printer over

671 Jan 05, 2023
🐱 Petkit feeder components for HomeAssistant

Petkit for HomeAssistant Installing Download and copy custom_components/xiaomi_miot folder to custom_components folder in your HomeAssistant config fo

62 Dec 29, 2022
iot-dashboard: Fully integrated architecture platform with a dashboard for Logistics Monitoring, Internet of Things.

Fully integrated architecture platform with a dashboard for Logistics Monitoring, Internet of Things. Written in Python. Flask applicati

2 Jul 29, 2022
Rasberry Pie GPIO memory game. Press the corresponding key to the lit LED.

RPie-keyboard-game Rasberry Pie GPIO memory game. Press the corresponding key to the lit LED. Randem LED (general output) is lit up on rasberrypi rand

Shawn Dowling 1 Oct 24, 2021
Hotplugger: Real USB Port Passthrough for VFIO/QEMU!

Hotplugger: Real USB Port Passthrough for VFIO/QEMU! Welcome to Hotplugger! This app, as the name might tell you, is a combination of some scripts (py

DARKGuy (Alemar) 66 Nov 24, 2022
An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and display it on a FeatherS2 in an OLED display.

CircuitPython IoT Trivia ESP32-S2 OLED Version An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and

Kevin Thomas 1 Nov 27, 2021
Poupool is an overflow swimming pool control software

Poupool - The swimming pool controller Poupool is a swimming pool control software. It is based on Transitions, Pykka and Paho MQTT. The user interfac

Cyril Jaquier 8 Jul 18, 2022
This is a collection of python modules that interact with the Ryze Tello drone.

This is a collection of python modules that interact with the Ryze Tello drone.

DJI-SDK 1.2k Jan 03, 2023
ESP32 micropython implementation of Art-Net client

E_uArtnet ESP32 micropython implementation of Art-Net client Instalation Use thonny Open the root folder in thonny and upload the Empire folder like i

2 Dec 07, 2021
Red Light Green Light Robot

Red Light Green Light Robot The primary problem addressed by our project is robotic follower behavior i.e. maintaining distance from a moving target.

Will Romano 2 Nov 20, 2021
Point Density-Aware Voxels for LiDAR 3D Object Detection (CVPR 2022)

PDV PDV is LiDAR 3D object detection method. This repository is based off [OpenPCDet]. Point Density-Aware Voxels for LiDAR 3D Object Detection Jordan

Toronto Robotics and AI Laboratory 114 Dec 21, 2022
Various programs in Atari BASIC for #FujiNet for Atari 8-bit

FujiNet Various programs in Atari BASIC for #FujiNet for Atari 8-bit FujiNet-3D Tic Tac Toe In 1978, Scott Adams wrote a 3-D Tic Tac Toe game, for pla

Kay Savetz 2 Jan 01, 2022
Raspberry Pi Spectrometer

PySpectrometer 2021-03-05 Raspberry Pi Spectrometer The PySpectrometer is a Python (OpenCV and Tkinter) implementation of an optical spectrometer. The

Les Wright 538 Jan 05, 2023
Turns a compatible Raspberry Pi device into a smart USB drive for PS4/PS5.

PSBerry A WIP project for Raspberry Pi, which turns a compatible RPI device into a smart USB drive for PS4/PS5. Allows for save management of PS4 game

Filip Tomaszewski 2 Jan 15, 2022
Real-time Coastal Monitoring at the University of Hawaii at Manoa

Coastal Monitoring at the University of Manoa Source code for Beaglebone/RPi-based data loggers, shore internet gateways, and web server. Software dev

Stanley Lio 7 Dec 07, 2021
Testing out some (stolen) DMA code for RP2040 Micropython

RP2040_micropython_dma testing out some (stolen) DMA code for RP2040 Micropython. Heavy inspiration and some code from https://iosoft.blog/2021/10/26/

2 Dec 29, 2022