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
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
SALUS THERMOSTAT Custom component for Home-Assistant

Home-Assistant Custom Components Custom Components for Home-Assistant (http://www.home-assistant.io) Salus Thermostat Climate Component My device is R

21 Dec 18, 2022
a weather application for the raspberry pi and the Pimorioni Inky pHAT.

raspi-weather a weather application for the raspberry pi and the Inky pHAT

Derek Caelin 59 Oct 24, 2022
The software that powers the sPot: a 4th generation

This code is meant to accompany this project in which a Spotify client is built into an iPod "Classic" from 2004. Everything is meant to run on a Raspberry Pi Zero W.

Guy Dupont 683 Dec 28, 2022
Samples for robotics, node, python, and bash

RaspberryPi Robot Project Technologies: Render: intent Currently designed to act as programmable sentry.

Martin George 1 May 31, 2022
LED effects plugin for klipper

This plugin allows Klipper to run effects and animations on addressable LEDs, such as Neopixels, WS2812 or SK6812.

Julian Schill 238 Jan 04, 2023
This is a Virtual Keyboard which is simple yet effective to use.

Virtual-Keyboard This is a Virtual KeyBoard which can track finger movements and lets you type anywhere ranging from notepad to even web browsers. It

Jehan Patel 3 Oct 01, 2021
A ESP32 project template with a web interface built in React

ESP AP Webserver demo.mp4 This is my experiment with "mobile app development" for the ESP32. The project consists of two parts, the ESP32 code and the

8 Dec 15, 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
Automatic Watering System using Soil Moisture Sensor and RTC Timer with Arduino

Automatic-Watering-System - Technical Answers to Real-World Problems. Evolution of Watering Manually to Watering Automatically.

Vaishnavi Pothugunta 4 Dec 31, 2021
🌱 - WebhookHard◞ Fines Educativos ◟

v1.0.0 WebhookHardware ¿Que es WebhookHardware? WebhookHardware se trata de un proyecto tratado para sacar informacion sobre el hardware de tus victim

3 Jun 14, 2021
Programming of Robotics Systems course at the University of Aveiro, Portugal, 2021-2022.

Programação de Sistemas Robóticos Miguel Riem Oliveira Universidade de Aveiro 2021-2022 Projeto AtlasCar Projecto RACE IROS 2014 AtlasCar2 ATOM IROS 2

Miguel Riem de Oliveira 22 Jul 13, 2022
The robot is an autonomous small scale racing car using NVIDIA Jetson Nano.

The robot is an autonomous small scale racing car using NVIDIA Jetson Nano. This project utilizes deep learning neural network framework Keras/Tensorflow, together with computer vision library OpenCV

1 Dec 08, 2021
Water quality integration for Home Assistant with data provided by Budapest FVM

Water Quality FVM (Budapest, HU) custom integration for Home Assistant This custom component integrates water quality information provided by Budapest

Atticus Maximus 3 Dec 23, 2021
Home Assistant custom integration for e-distribución

e-Distribución is an energy distribution company that covers most of South Spain area. If you live in this area, you probably are able to register into their website to get some information about you

VMG 17 Sep 07, 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
Segger Embedded Studio project for building & debugging Flipper Zero firmware.

Segger Embedded Studio project for Flipper Zero firmware Установка Добавить данный репозиторий в качестве сабмодуля в корень локальной копии репозитор

25 Dec 28, 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 07, 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 python project based on a TV show Wheel of Fortune

Wheel-of-Fortune-using-Python Wheel of Fortune in python this game is the hands-on project in Python 3 Programming Specialization offered By Universit

Eszter Pai 1 Jan 03, 2022