Skip to main content

BOM Helper

A Python CLI tool for fetching electronic component information from LCSC (a Chinese electronics component distributor). Quickly retrieve part specifications, pricing, datasheets, and images for your Bill of Materials (BOM) management.

Features

  • Batch Processing: All commands support multiple space-separated part numbers
  • Part Information: Retrieve detailed component specifications in JSON format
  • Datasheet Download: Automatically download component datasheets as PDFs
  • KiCad Library Export: Export symbols, footprints, and 3D models for KiCad
  • Comprehensive Data Extraction:
    • Manufacturer and part numbers
    • Technical specifications (package type, category, etc.)
    • Pricing tiers for different quantities
    • Product images
    • Datasheet URLs

Installation

uv tool install bom-helper

After installation, use bom directly — no uv run prefix needed.

Usage

Get Component Information

Retrieve detailed information about one or more components by LCSC part number:

# Single part
bom info C124378

# Multiple parts
bom info C2040 C124378 C100

This returns a JSON object with all available information:

{
  "url": "https://www.lcsc.com/product-detail/C124378.html",
  "Manufacturer": "hanxia",
  "Mfr. Part #": "HX PM2.54-1x7P TP-YQ",
  "Description": "2.54mm 1kV 7P 3A 1 Gold Brass",
  "Datasheet": "https://www.lcsc.com/datasheet/C124378.pdf",
  "Specifications": {
    "Category": "Connectors",
    "Package": "SMD,P=2.54mm"
  },
  "Pricing": [
    {"Qty": "11+", "Unit Price": "€ 0.2071", "Ext. Price": "€ 2.28"},
    {"Qty": "110+", "Unit Price": "€ 0.1639", "Ext. Price": "€ 18.03"}
  ],
  "Images": [
    "https://assets.lcsc.com/images/lcsc/900x900/front.jpg",
    "https://assets.lcsc.com/images/lcsc/900x900/back.jpg"
  ]
}

Download Datasheet

Download datasheets for one or more components:

# Save to current directory
bom pdf C124378

# Download multiple datasheets
bom pdf C2040 C124378 C100

# Save to a specific directory
bom pdf C124378 --dir ./datasheets

# Batch download to directory
bom pdf C2040 C2041 C2042 --dir ./datasheets

Export to KiCad

Export component symbols, footprints, and 3D models for use in KiCad:

# Export everything (symbol + footprint + 3D model) for one part
bom add C2040

# Export multiple parts at once
bom add C2040 C2041 C2042

# Export to a custom location
bom add C2040 --output ./kicad-libs/lcsc

# Update existing components
bom add C2040 --overwrite

# Export only specific parts
bom symbol C2040    # Symbol only
bom footprint C2040 # Footprint only
bom 3d C2040        # 3D model only

# All commands support multiple parts
bom symbol C2040 C2041
bom footprint C2040 C2041 C2042

Default location: ~/Documents/Kicad/easyeda2kicad/easyeda2kicad (creates easyeda2kicad.kicad_sym, easyeda2kicad.pretty/ and easyeda2kicad.3dshapes/)

The tool will:

  • Create library files if they don't exist
  • Detect existing components and skip them (use --overwrite to update)
  • Show you the paths to all created files

Check Version

bom --version   # or -v

Development

Setup

git clone https://github.com/rhiza-fr/bom-helper.git
cd bom-helper

# Install development dependencies
uv sync --group dev

Running Tests

# Run all tests
uv run pytest

# Run with coverage report
uv run pytest --cov

# Run specific test file
uv run pytest tests/test_lcsc.py

Code Quality

This project uses ruff for linting and formatting:

# Format code
uv run ruff format

# Check for linting issues
uv run ruff check

# Auto-fix linting issues
uv run ruff check --fix

How It Works

BOM Helper provides two main capabilities:

1. Component Information & Datasheets

Scrapes the LCSC website to extract component information:

  • Fetches product page HTML for a given part number
  • Parses structured data from tables and embedded JavaScript
  • Returns information in a clean, structured format

Edge cases handled:

  • Extracting URLs from relative paths
  • Cleaning manufacturer names (removes "Asian Brands" badges)
  • Parsing pricing tables with quantity tiers
  • Extracting product images from embedded JavaScript

2. KiCad Library Export

Integrates with easyeda2kicad to generate KiCad library files:

  • Fetches CAD data from EasyEDA API
  • Converts symbols, footprints, and 3D models to KiCad format
  • Manages library files and prevents duplicates
  • Built on top of easyeda2kicad with a simpler batch-friendly CLI

Requirements

  • Python 3.12 or higher
  • Internet connection (to fetch data from LCSC)

Part Number Format

All commands require valid LCSC part numbers. LCSC part numbers must:

  • Start with 'C' (uppercase)
  • Be followed by one or more digits
  • Contain no other characters (no spaces, hyphens, paths, etc.)

Valid examples: C2040, C124378, C999999999 Invalid examples: C:\path, C123abc, C-123, c2040 (lowercase), C 123 (space)

License

MIT — see LICENSE.

Disclaimer

This tool is not affiliated with or endorsed by LCSC. It is designed for personal use to help manage Bills of Materials. Please respect LCSC's terms of service and use this tool responsibly.

Metadata

Release files for bom-helper 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bom-helper 0.1.2
File Size Uploaded Provenance Actions
bom_helper-0.1.2.tar.gz 49.8 kB With provenance Details for bom_helper-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bom-helper 0.1.2
File Interpreter ABI Platform Actions
bom_helper-0.1.2-py3-none-any.whl Python 3 none any Details for bom_helper-0.1.2-py3-none-any.whl

Total release size: 61.8 kB

Release files / bom_helper-0.1.2.tar.gz

Download URL bom_helper-0.1.2.tar.gz
Size 49.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3bf87798d3e4d6734c103cc6e97e1fa33090a41f3fd7280dacba81e7de49c50c
BLAKE2b-256 checksum
How to use checksums
49fac04d8d2126beb3647eb9b795b76f2aa9155ae3eec04e918085bdd1aaa826
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / bom_helper-0.1.2-py3-none-any.whl

Download URL bom_helper-0.1.2-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a8c9bf67b9e244548c358935762c4ad7dc839ba4ee6c9572d000ac230aa4b18
BLAKE2b-256 checksum
How to use checksums
8f814de10b4c44b84f9aac4c1a1678626d4ae0960639a802d1f70186096d873f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for bom-helper 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bom_helper-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page