Skip to content

hashgraph-online/awesome-codex-plugins / plugins/aklofas/kicad-happy/skills/lcsc

Search LCSC Electronics for electronic components — find parts by LCSC number (Cxxxxx) or MPN, check stock/pricing, download datasheets, analyze specifications. Sister company to JLCPCB, same parts library. Sync and maintain a local datasheets directory for a KiCad project, or use batch MPN-list seeding (`--mpn-list`) for bulk workflows without a project. No API key needed — uses the free jlcsearch community API. Use this skill when the user mentions LCSC, JLCPCB parts library, JLCPCB assembly parts, production sourcing, Cxxxxx part numbers, needs to find LCSC equivalents for parts, is preparing a BOM for JLCPCB assembly, or wants to download datasheets and LCSC is available. For package cross-reference tables and BOM workflow, see the `bom` skill.

FileKindSize
SKILL.mdskill md11.9 KB
scripts/_core_path.pyscript697 B
scripts/fetch_datasheet_lcsc.pyscript6.5 KB
scripts/provider_lcsc.pyscript14.2 KB
scripts/search_lcsc.pyexecutablescript15.0 KB
scripts/sync_datasheets_lcsc.pyscript2.6 KB
scripts/test_search_lcsc.pyexecutablescript22.6 KB

scripts/sync_datasheets_lcsc.py

View on GitHub
#!/usr/bin/env python3
"""Sync a local datasheets directory for a KiCad project via LCSC/jlcsearch.

Extracts components with MPNs or LCSC codes from a KiCad schematic (or
pre-computed analyzer JSON), searches jlcsearch for datasheet URLs,
downloads missing PDFs, and maintains a manifest.json file (legacy name index.json
still read for backward compat).

The manifest.json format matches across distributor skills so they can
contribute to the same datasheets directory. The source field
distinguishes which distributor provided the datasheet.

No API key required — uses the jlcsearch community API (free, no auth).
LCSC's CDN (wmsc.lcsc.com) serves PDFs directly without bot protection.

Download strategy per part:
  1. Try the datasheet URL from the schematic itself
  2. Search jlcsearch API → download from LCSC CDN (direct PDF URL)
  3. Try manufacturer-specific alternative URL patterns

Usage:
    python3 sync_datasheets_lcsc.py <file.kicad_sch>
    python3 sync_datasheets_lcsc.py <analyzer_output.json> --output ./datasheets
    python3 sync_datasheets_lcsc.py <file.kicad_sch> --force     # retry failures
    python3 sync_datasheets_lcsc.py <file.kicad_sch> --dry-run   # preview only
    python3 sync_datasheets_lcsc.py --mpn-list mpns.txt --dry-run
    python3 sync_datasheets_lcsc.py --mpn-list mpns.txt --output ./datasheets

Dependencies:
    - requests (pip install requests) — strongly recommended
    - playwright (pip install playwright && playwright install chromium) — optional, only with datasheets.allow_private_hosts
"""

import sys
from pathlib import Path

# Import from sibling script (same skill)
sys.path.insert(0, str(Path(__file__).parent))
import _core_path  # noqa: F401
import provider_lcsc
from distributor_core import sync as core_sync
from distributor_core.cli import sync_main


# ---------------------------------------------------------------------------
# Core sync logic
# ---------------------------------------------------------------------------


def sync_datasheets(**kwargs) -> dict:
    """Sync via the shared driver (distributor_core.sync) with the lcsc adapter. Returns summary dict."""
    return core_sync.sync_datasheets(provider_lcsc, **kwargs)


def main():
    sync_main(
        sync_datasheets,
        description=("Sync datasheets for a KiCad project via LCSC/jlcsearch (no API key needed). Parts with neither an MPN nor a part "
                     "number from this distributor are skipped."),
        vendor="LCSC",
        delay=0.5,
        delay_help="Seconds between API calls (default: 0.5)",
    )


if __name__ == "__main__":
    from kicad_core.cli import utf8_stdio
    utf8_stdio()
    main()
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 319kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 197kUpdated Claude CodeCodexVerifiedInstall