Supply chain

Manufacturer parts, prices and stock from part data providers.

Manufacturer parts, prices and stock come from part data providers: Octopart (Nexar), Mouser, Digi-Key and LCSC built in, plus add-on providers registered with api.parts.register. A recorded fixture provider (the data in fixtures/parts/) answers without a network or keys, for demos and tests.

This is not a procurement feature: the Electronics Designer never orders, fills a distributor cart or keeps live stock in the design views. Searches show what the providers answered (or the cache holds); the schematic, the board, the BOM view and the library browser show the part fields and, in the library browser, cached facts only. edsnx bom cost --cart writes a CSV file you upload to the distributor yourself.

Parts ▸ Providers. Electronics Designer: Parts ▸ Providers: API keys, cache, offline mode… (also Providers… in Add component ▸ Parts) lists every provider, configured or not:

ColumnMeaning
Stateconfigured; not configured (no key: searches skip it, nothing fails); key incomplete (Nexar and Digi-Key need a client id and a secret); no key needed (LCSC); recorded answers (the fixture provider); add-on
Searchedwhether searches use it (softforge.edsnx.parts.providers; empty: every configured provider)
Cacheits cache lifetime, how many answers are cached and how old the newest is
Last errorthe provider’s last failure and when

Each row has buttons Add / replace key, Remove key and Test key (one live search for NE555 that skips the cache and offline mode and reports the hit count and time, or the provider’s error). Keys go to VS Code’s SecretStorage only (secrets softforge.parts.<provider>.…), never to settings.json. The CLI reads NEXAR_CLIENT_ID / NEXAR_CLIENT_SECRET, MOUSER_API_KEY, DIGIKEY_CLIENT_ID / DIGIKEY_CLIENT_SECRET and LCSC_API_KEY. In Add component ▸ Parts a provider without its key shows a dashed not configured chip; clicking it opens the page.

Caching and offline mode. Answers are cached on disk for softforge.edsnx.parts.cacheHours (default 24 h); softforge.edsnx.parts.cacheHoursByProvider sets a lifetime per provider ({ "mouser": 6, "lcsc": 72 }). Offline mode (softforge.edsnx.parts.offline, Electronics Designer: Toggle part data offline mode, or the page’s Offline item) answers from the cache only, whatever its age, and asks no provider; a status bar chip Parts offline · 3 h shows it with the age of the newest cached answer (a click goes back online). The Parts table says how old what it shows is: From the cache, 2 h old, Stale: cached data, 3 d old (a provider did not answer) when a provider failed and an older answer was used, Offline: cached data, 5 h old. softforge.edsnx.parts.currency and parts.exchangeRates set the currency.

Rate limits and provider errors. A failing provider is reported once per session for each kind of error (refused key, rate limit, HTTP failure), not once per part: one notification with a Providers… button, and every error in the Electronics Designer Parts output. A provider that refused its key is not asked again until the key changes; one that answered “rate limited” rests for a minute while cached answers are served. edsnx bom cost lists each provider error once (providerErrors), and a BOM line left without an answer says so without repeating the message.

Parts in Add component. Tab in Add component (Ctrl+A) cycles Symbols → Footprints → Parts: a table of manufacturer parts (MPN, manufacturer, stock, price at 100, lifecycle, whether a symbol, footprint and 3D model exist) with provider chips and the filters In stock, Active only and Approved manufacturers. NRND, EOL and obsolete parts are red. Enter maps the part to a KiCad symbol and footprint and places it with the fields MPN, Manufacturer, Datasheet, Description, Lifecycle and Supplier:<distributor> (the chosen offer’s SKU). When no library symbol matches, the provider’s ECAD data can be imported into the project library parts (parts.importEcad), and after placement the 3D model can be downloaded into the project’s 3d/ folder (parts.download3d). The library browser shows the cached MPN, stock and price of symbols that carry an MPN field (it never queries a provider by itself).

Parts on the board. On a board, Add component (Ctrl+A) has the chips Footprints and Parts (Tab switches): the Parts table searches the same providers with the same filters, and Enter finds the part’s footprint (a library footprint for its package, else the provider’s ECAD footprint, imported on consent) and starts the footprint place tool; the placed footprint carries the fields MPN, Manufacturer, Datasheet, Description, Lifecycle and Supplier:<distributor> in the same edit. When no footprint fits, the Footprints list opens on the package and the fields go with the footprint you pick.

BOM cost (edsnx bom cost) resolves the BOM lines (grouped by MPN, else value and footprint; DNP parts and parts the variant does not fit are not bought) against the providers and picks the cheapest offer for the quantity (MOQ, order multiple, price breaks, parts in stock first, approved manufacturers and preferred distributors). It reports the cost per board and in total for the number of boards, the cost of each variant, lifecycle, stock and approval warnings, and writes a Mouser, Digi-Key or LCSC cart (--cart) or a Markdown / CSV cost report (--report) with a Supplier SKU column: the chosen offer’s distributor part number, else the schematic’s Supplier:<distributor> field. The BOM view of the schematic shows no offers or prices (see BOM and the Symbol Fields Table), but it has a Supplier SKU column, from the Supplier:<distributor> fields of each line (“595-NE555P”, or “Mouser 595-NE555P · LCSC C46749” for several distributors), shown when a line has one (Options ▸ Supplier SKU hides it; Export includes those fields). Project settings (approved manufacturers, boards, currency, preferred distributors, attrition) live in <project>.kicad_parts.json, which KiCad never reads. The documentation BOM table has Manufacturer, Supplier SKU and Unit price columns, filled from the symbols’ fields.

text
edsnx parts search "ne555 soic" --providers lcsc,mouser
edsnx parts offers --mpn NE555DR
edsnx bom cost blinky.kicad_pro --qty 100 --variant Lite --providers fixture --report fab/cost.md
edsnx bom cost . --qty 10 --cart lcsc

Provider tests. Every adaptor is tested on answers in the APIs’ documented shape (search, details, offers, and the error answers: bad key, expired token, rate limit, quota). Recording live answers needs real accounts:

text
NEXAR_CLIENT_ID=… NEXAR_CLIENT_SECRET=… MOUSER_API_KEY=… DIGIKEY_CLIENT_ID=… DIGIKEY_CLIENT_SECRET=… \
  npx tsx scripts/record-parts-fixtures.ts --providers nexar,mouser,digikey,lcsc --errors

writes test/fixtures/parts/recorded/ (keys, tokens, client ids, cookies and account ids removed; a file still holding a key is refused); review the diff, commit it, and the tests replay it. EDSNX_PARTS_LIVE=1 npm test also runs a live check of each provider whose keys are set.

Limits: no live recording is committed yet (it needs the maintainer’s Nexar, Mouser and Digi-Key accounts; the command above records them), so the adaptors are checked against answers in the documented shape; the cache lifetime per provider is a VS Code setting (edsnx uses 24 h, and --offline for cached answers only); the Mouser call-limit and LCSC error shapes follow public reports rather than a specification. The documentation BOM table shows one distributor’s SKU per line (the first Supplier:<distributor> field).

Part fields (MPN convention)#

Manufacturer parts live on the symbols as fields, so the design keeps them without any provider:

FieldWritten on pickRead on resolve
MPNthe part numberthe BOM line key and the provider search; also read from Manufacturer Part Number, Manufacturer_Part_Number, MFR PN, MfrPN, Mfr. No, Part Number, PartNumber, PN
Manufacturerthe manufacturerthe line key and the approved-manufacturer match; also MFR, Mfr, Manufacturer Name
Datasheet, Descriptionthe provider’sshown, not resolved
LifecycleActive, NRND, EOL, Obsolete, PreviewBOM lifecycle warnings; also Lifecycle Status, Status
Supplier:<distributor>the chosen offer’s SKU (Supplier:Mouser = 595-NE555P)the BOM Supplier SKU column and the cart files

Filled on pick: Add component ▸ Parts (schematic and board) writes these fields in the placing edit. Read on resolve: edsnx bom cost groups the lines by MPN and Manufacturer (else Value and Footprint) and searches the providers by the MPN; the BOM view and the documentation BOM table show the same fields. Variants override: a variant’s field overrides (variant.set with fields, e.g. { "MPN": "TLC555CP" }, stored in the .kicad_pro) replace the symbol’s fields for that variant’s BOM and cost, so one schematic carries a different part per assembly variant.

Documentation for Electronics Designer 2.3.60.