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
Custom component for interacting with Octopus Energy

Home Assistant Octopus Energy ** WARNING: This component is currently a work in progress ** Custom component built from the ground up to bring your Oc

David Kendall 116 Jan 02, 2023
A Fear and Greed index visualiser for Bitcoin on a SSD1351 OLED Screen

We're Doomed - A Bitcoin Fear and Greed index OLED visualiser Doom is a first-person-shooter from the 1990s. The health status monitor was one of the

VEEB 19 Dec 29, 2022
🎃 Some spooky code samples to hack yourself a pumpkin 👻

🎃 Tech Or Treat 👻 It's spooky season for those who celebrate Halloween, and to get in the spirit (spirit - get it? 👻 ) we thought it would be fun t

Jim Bennett 5 Feb 07, 2022
Detic ros - A simple ROS wrapper for Detic instance segmentation using pre-trained dataset

Detic ros - A simple ROS wrapper for Detic instance segmentation using pre-trained dataset

Hirokazu Ishida 12 Nov 19, 2022
Windhager myComfort custom component for Home Assistant

Windhager myComfort custom component for Home Assistant

5 Apr 27, 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
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 01, 2022
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
A script and GUI for controlling stepper motors from an arduino

A script and GUI for controlling stepper motors from an arduino (nema 23 in my case but should work for others in general)

Pip 2 Aug 01, 2022
Universal Xiaomi MIoT integration for Home Assistant

Xiaomi MIoT Raw 简体中文 | English MIoT 协议是小米智能家居从 2018 年起推行的智能设备通信协议规范,此后凡是可接入米家的设备均通过此协议进行通信。此插件按照 MIoT 协议规范与设备通信,实现对设备的状态读取及控制。

1.9k Jan 02, 2023
Интеграция Home Assistant с ЛК "Интер РАО"

ЕЛК ЖКХ «Интер РАО» для Home Assistant Предоставление информации о текущем состоянии ваших аккаунтов в ЕЛК ЖКХ. Введение @ TODO @ Установка Посредство

Alexander Ryazanov 27 Nov 05, 2022
Toy robot that traverses on a finite surface

Toy Robot Challenge - Release Notes November 12, 2021 New features Initialisation - Users can set the home position and heading of the robot. Position

Ze Fei Teo 0 Feb 03, 2022
Sleep Functionality for Adafruit MacroPad RP2040

Adafruit-MacroPad-RP2040 Sleep Functionality for Adafruit MacroPad RP2040 Details This is a modification of AdaFruit project bundle found here specifi

9 Dec 18, 2022
This Home Assistant custom component adds support for controlling Midea dehumidiferes on local network.

This is a custom component for Home assistant that adds support for Midea dehumidifier appliances via the local area network. midea-dehumidifier-lan H

Nenad Bogojevic 97 Jan 08, 2023
Terkin is a flexible data logger application for MicroPython and CPython environments.

Terkin Data logging for humans, written in MicroPython. Documentation: https://terkin.org/ Source Code: https://github.com/hiveeyes/terkin-datalogger

hiveeyes 45 Dec 15, 2022
Zev es un Bot/Juego RPG de Discord creado en y para aprender Python.

Zev es un Bot/Juego RPG de Discord creado en y para aprender Python.

Julen Smith 3 Jan 12, 2022
The goal of this project is for anyone with an old printer to be able to double-sided printing.

Welcome to PDF-double-side! Hi! I'm 15. I have a old printer so I can't print double-sided outs. The goal of this project is for anyone with an old pr

DejaVu 4 Dec 28, 2021
Sleep As Android integration for Home Assistant

Sleep As Android custom integration This integration will allow you to get events from your SleepAsAndroid application in a form of the sensor states

Igor 84 Dec 30, 2022
Smart Tech Automation Remote via Kinematics Gesture control for IoT devices

STARK Smart Tech Automation Remote via Kinematics Gesture control for IoT devices View Demo · Report Bug · Request Feature Table of Contents About The

Juseong (Joe) Kim 1 Jan 29, 2022
Philippe 1 Jan 09, 2022