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
A small Python app to converse between MQTT messages and 433MHz RF signals.

mqtt-rf-bridge A small Python app to converse between MQTT messages and 433MHz RF signals. This acts as a bridge between Paho MQTT and rpi-rf. Require

David Swarbrick 3 Jan 27, 2022
DIY split-flap display

The goal is to make a low-cost display that's easy to fabricate at home in small/single quantities (e.g. custom materials can be ordered from Ponoko or similar, and other hardware is generally availa

Scott Bezek 2.5k Jan 05, 2023
This tool emulates an EMV-CAP device, to illustrate the article "Banque en ligne : à la decouverte d'EMV-CAP" published in MISC

About This tool emulates an EMV-CAP device, to illustrate the article "Banque en ligne : à la decouverte d'EMV-CAP" published in MISC, issue #56 and f

Philippe Teuwen 28 Nov 21, 2022
Homeautomation system created with Raspberry Pi 3 and Firebase.

Homeautomation System - Raspberry Pi 3 Desenvolvido com Python, Flask com AJAX e Firebase permite o controle local e remoto Itens necessários Raspberr

Joselino Santos 0 Mar 09, 2022
FHEM Connector for FHT Heating devices

home-assistant-fht from: https://github.com/Rsclub22 FHEM Connector for FHT Heating devices (connected via FHEM) Requires FHEM to work You can find FH

5 Dec 01, 2022
raspberry pi servo control using pca9685

RPi_servo-control_pca9685 raspberry pi 180° servo control using pca9685 Requirements Requires you to have the adafruit servokit library installed You

1 Jan 10, 2022
E-Ink Magic Calendar that automatically syncs to Google Calendar and runs off a battery powered Raspberry Pi Zero

E-Ink Magic Calendar that automatically syncs to Google Calendar and runs off a battery powered Raspberry Pi Zero

2.8k Dec 30, 2022
Code for the paper "Planning with Diffusion for Flexible Behavior Synthesis"

Planning with Diffusion Training and visualizing of diffusion models from Planning with Diffusion for Flexible Behavior Synthesis. Guided sampling cod

Michael Janner 310 Jan 07, 2023
Transform a Raspberry Pi into a network diagnostic machine.

EtherView Last updated jan 30, 2022. Welcome to the EtherView project! This is a project to transform a RaspberryPi into a portable network diagnostic

1 Jan 30, 2022
2D waypoints will be predefined in ROS based robots to navigate to the destination avoiding obstacles.

A number of 2D waypoints will be predefined in ROS based robots to navigate to the destination avoiding obstacles.

Arghya Chatterjee 5 Nov 05, 2022
LUNA: a USB multitool & nMigen library

LUNA is a full toolkit for working with USB using FPGA technology; and provides hardware, gateware, and software to enable USB applications.

Great Scott Gadgets 750 Dec 28, 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
Better support for Nuki devices to the Home Assistant

Another attempt to add a better support for Nuki devices to the Home Assistant Features: Lock interface implementation Uses local webhook from bridge

Konstantin 105 Jan 07, 2023
Baseline model for Augmented Home Assistant

Dataset Preparation Step 1. Rename the Virtual-Home output directory to 'vh.[name]', for example: 'vh.door' Make sure the directory contains 100+ fram

Stanford HCI 1 Aug 24, 2022
Play a song with a 3D printer.

MIDI to GCODE Play a song with a FDM 3D printer. SLA printers don't have motors, so they cannot play music. Warning: Be ready to turn off the 3D print

Patrick 6 Apr 11, 2022
A modular sequencer based on Pi Pico & EuroPi

PicoSequencer A modular sequencer based on Pi Pico & EuroPi by Zeno Van Moerkerke / Keurslager Kurt For now it is 'only' a trigger sequencer, but I si

5 Oct 27, 2022
Code and build instructions for Snap, a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment

Code and build instructions for Snap, a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment. On row of LEDs shows the cost of the hour, the other row the co

Johan Jonk Stenström 3 Sep 08, 2022
Scripts for measuring and displaying thermal behavior on Voron 3D printers

Thermal Profiling Measuring gantry deflection and frame expansion This script runs a series of defined homing and probing routines designed to charact

Jon Sanders 30 Nov 27, 2022
Technical Answers to Real-World Problems. Evolution of Watering Manually to Watering Automatically.

Automatic Watering System using Soil Moisture Sensor and RTC Timer with Arduino Technical Answers to Real-World Problems Know the plant, Grow the plan

NelakurthiSudheer 3 Jan 03, 2022
GUI wrapper designed for convenient service work with TI CC1352/CC2538/CC2652 based Zigbee sticks or gateways. Packed into single executable file

ZigStar GW Multi tool is GUI wrapper firtsly designed for convenient service work with Zig Star LAN GW, but now supports any TI CC1352/CC2538/CC2652 b

133 Jan 01, 2023