Difference between revisions of "Downloading KiCAD files for LCSC components"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
'''NOTE:''' This is all based on using a fresh install of Debian 12. | '''NOTE:''' This is all based on using a fresh install of Debian 12. | ||
= Installing easyeda2kicad = | = Installing easyeda2kicad = | ||
* <code>apt install pip</code> | * <code>apt install pip</code> | ||
Line 42: | Line 41: | ||
done | done | ||
</SyntaxHighlight> | </SyntaxHighlight> | ||
= Usage = | |||
You can download files for one or more LCSC components at a time. | |||
Examples: | |||
* lcsc C2040 | |||
** will download symbol, footprint & 3D files for the component with LCSC catalogue number C2040 into a subfolder of ~/Documents/LCSC | |||
* lcsc C2040 C5350143 C5374682 | |||
** will download symbol, footprint & 3D files for all 3 component into separate subfolders of ~/Documents/LCSC |
Revision as of 17:00, 9 June 2024
NOTE: This is all based on using a fresh install of Debian 12.
Installing easyeda2kicad
apt install pip
pip install --break-system-packages easyeda2kicad
The --break-system-packages bit is here because current versions of Python (at least on Debian...) do paranoid things... Apparently, someone decided that Python code is hazardous...
The Wrapper Script
#!/usr/bin/bash
########################################################
### This little script wraps around ###
### https://github.com/uPesy/easyeda2kicad.py ###
### and provides a much more usable set of downloads ###
### ###
### Before using, either create an LCSC folder in ###
### your Documents or edit the OUTPUT= line below. ###
########################################################
OUTPUT='Documents/LCSC/'
for i in ${*}
do
echo ${i}
if easyeda2kicad --full --overwrite --lcsc_id=${i} --output ~/${OUTPUT}${i}
then
mkdir ~/${OUTPUT}${i}/
mv ~/${OUTPUT}${i}.kicad_sym ~/${OUTPUT}${i}/
mv ~/${OUTPUT}${i}.3dshapes/*.step ~/${OUTPUT}${i}/
# if you really want the WRL also, change the above line to:
# mv ~/${OUTPUT}${i}.3dshapes/* ~/${OUTPUT}${i}/
mv ~/${OUTPUT}${i}.pretty/* ~/${OUTPUT}${i}/
rm -r ~/${OUTPUT}${i}.*
echo Got it...
else
rm -r ~/${OUTPUT}${i}.*
touch ~/${OUTPUT}${i}.HasNoStuffAvailable
echo Nothing to get...
fi
done
Usage
You can download files for one or more LCSC components at a time.
Examples:
- lcsc C2040
- will download symbol, footprint & 3D files for the component with LCSC catalogue number C2040 into a subfolder of ~/Documents/LCSC
- lcsc C2040 C5350143 C5374682
- will download symbol, footprint & 3D files for all 3 component into separate subfolders of ~/Documents/LCSC