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
Automatically draw a KiCad schematic for a circuit prototyped on a breadboard.

Schematic-o-matic Schematic-o-matic automatically draws a KiCad schematic for a circuit prototyped on a breadboard. How It Works The first step in the

Nick Bild 22 Oct 11, 2022
🐱 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

null 62 Dec 29, 2022
Home Assistant custom components MPK-Lodz

MPK Łódź sensor This sensor uses unofficial API provided by MPK Łódź. Configuration options Key Type Required Default Description name string False MP

Piotr Machowski 3 Nov 1, 2022
A lightweight script for updating custom components for Home Assistant

Updater for Home Assistant This is a lightweight script for updating custom components for Home Assistant. If for some reason you do not want to use H

Alex X 12 Sep 21, 2022
OpenStickFirmware is open source software designed to handle any and all tasks required in a custom Fight Stick

OpenStickFirmware is open source software designed to handle any and all tasks required in a custom Fight Stick. It can handle being the brains of your entire stick, or just handling the bells and whistles while your Brook board talks to your console.

Sleep Unit 23 Nov 24, 2022
♟️ QR Code display for P4wnP1 (SSH, VNC, any text / URL)

♟️ Display QR Codes on P4wnP1 (p4wnsolo-qr) ?? QR Code display for P4wnP1 w/OLED (SSH, VNC, P4wnP1 WebGUI, any text / URL / exfiltrated data) Note: Th

PawnSolo 4 Dec 19, 2022
A python script for macOS to enable scrolling with the 3M ergonomic mouse EM500GPS in any application.

A python script for macOS to enable scrolling with the 3M ergonomic mouse EM500GPS in any application.

null 3 Feb 19, 2022
Scapy: the Python-based interactive packet manipulation program & library. Supports Python 2 & Python 3.

Scapy Scapy is a powerful Python-based interactive packet manipulation program and library. It is able to forge or decode packets of a wide number of

SecDev 8.3k Jan 8, 2023
a library for using WS2812b leds (aka neopixels) with Raspberry Pi Pico

pico_ws2812b a library for using WS2812b leds (aka neopixels) with Raspberry Pi Pico You'll first need to save the ws2812b.py file to your device (for

null 76 Nov 25, 2022
The ABR Control library is a python package for the control and path planning of robotic arms in real or simulated environments.

The ABR Control library is a python package for the control and path planning of robotic arms in real or simulated environments. ABR Control provides API's for the Mujoco, CoppeliaSim (formerly known as VREP), and Pygame simulation environments, and arm configuration files for one, two, and three-joint models, as well as the UR5 and Kinova Jaco 2 arms. Users can also easily extend the package to run with custom arm configurations. ABR Control auto-generates efficient C code for generating the control signals, or uses Mujoco's internal functions to carry out the calculations.

Applied Brain Research 277 Jan 5, 2023
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
CircuitPython library for the CH559 USB to Serial chip

CH559 (USB to Serial) CircuitPython Library Why? Because you might want to get keyboard/mouse/gamepad/HID input into your CircuitPython projects witho

Guy Dupont 3 Nov 19, 2022
Example for Calculating Robot Dynamics Using Pinocchio Library

A Example for Calculating Robot Dynamics Using Pinocchio Library Developed by: Xinyang Tian. Platform: Linux + Pinocchio. In this work, i use Pinocchi

Rot_Tianers 33 Dec 28, 2022
A python library written for the raspberry pi.

A python package for using certain components on the raspberry pi.

Builder212 1 Nov 9, 2021
Robot Framework keyword library wrapper for atlassian-python-api

Robot Framework keyword library wrapper for atlassian-python-api

Marcin Koperski 3 Jul 29, 2022
Ingeniamotion is a library that works over ingenialink and aims to simplify the interaction with Ingenia's drives.

Ingeniamotion Ingeniamotion is a library that works over ingenialink and aims to simplify the interaction with Ingenia's drives. Requirements Python 3

Ingenia Motion Control 7 Dec 15, 2022
Python library for the Phomemo m02s bluetooth thermal printer

Phomemo M02S Python library This is a basic Python library for controlling the Phomemo M02S bluetooth thermal printer. It probably only works on Mac &

Stargirl Flowers 28 Nov 7, 2022
Python library to interact with the GCE Electronics IPX800 device

A python library to control a GCE-Electronics IPX800 V4 device through its API.

Marc-Aurèle Brothier 2 Oct 20, 2021
A PYTHON Library for Controlling Motors using SOLO Motor Controllers with RASPBERRY PI, Linux, windows, and more!

A PYTHON Library for Controlling Motors using SOLO Motor Controllers with RASPBERRY PI, Linux, windows, and more!

SOLO Motor Controllers 3 Apr 29, 2022