Skip to content

Releases

ecadlib 0.4.0

Choose a tag to compare

@oliBrowne oliBrowne released this 29 Oct 04:52
c4bed9f

The first release since 0.3.1. It writes files 0.3.1 cannot read (librarian_state v3), so it is a minor release. Highlights: the release gate (only parts that pass the release check publish), change control (ecadlib part), the live accuracy benchmark at 87 of 110 parts fully right with none built wrong (docs/benchmark.md), ecadlib nexar signin, ecadlib mcp --http, and the time and review lines in ecadlib status.

Added

  • A dimension printed as a nominal with two one-sided tolerances is read as min/nom/max in either order, including an unsigned zero side: "0.7 +0.1/0" (JST's board hole) is 0.7 to 0.8 mm, "3.56 -0.25/+0.15" reads like "3.56 +0.15/-0.25". An unsigned non-zero side ("0.7 +0.1/0.05") stays unread, since it could mean either way.
  • An answer the parser rejected is kept (datasheet_results/rejected/), and a later parser that reads it uses it with no new read, so a parser fix can be re-scored for free.
  • When an answer leaves out a maker's land that its pages print (or TI's PowerPAD thermal land), the one feedback turn names the page and the land fields, so the part can build instead of being held. A saved batch answer gets that turn in a later live run too; --cached-only never sends it.
  • pypdfium2 is now a core dependency, so [datasheet] zoom_drawings can render close-ups on every install. With zoom on and no renderer, the reader warns once and marks each part zoom_skipped, and ecadlib eval run stops before it reads.
  • A maker's land can give only the thermal land (land.ep_across / ep_along, and ep_mask_*), for a land page that sizes the thermal pad but not the signal pads (OPA569DWP p19): the signal pads come from IPC-7351B and the thermal pad from the datasheet. Before, the reader had to leave the land out, and the part was held for a missing PowerPAD land. A land that gives only some of pad_length / pad_width / pad_center, or none of the pads, is flagged. The benchmark counts such a land as the maker's when the exposed pad is its thermal land. The reader's schema changed, so answers saved before are read again on the next live run.
  • The self-check takes a package name's EP size that the land page gives (its copper or mask opening) or that lies within the drawing's min-max. TLC5951DAP was read right and still refused, since its EP3.39x6.35 is TI's mask opening, not the midpoint of the 5.05-6.35 x 2.69-3.39 pad.
  • A wider retry keeps every page an earlier, narrower try sent, including the whole-PDF retry when it is cut to the page limit. TLC5951DAP's 22-page retry had lost the land pages 49-52 that its 6-page first try sent.
  • Solder-mask-defined thermal lands (TI PowerPAD). The datasheet reader can give the mask opening on the thermal land (land.ep_mask_across / land.ep_mask_along) when the land page draws it smaller than the copper, and the footprint draws it as KiCad does: copper only on the thermal pad, a mask-only opening of its own, and the paste windows inside the opening (TLC5951DAP: 5.2 x 12.5 mm copper, 3.39 x 6.35 mm open). Altium gets the copper pad tented and the opening as a Top Solder region. The pad check takes a mask-only opening over a pad's centre as that pad's mask, the paste check measures such a land's paste against its opening, and a rectangular mask window read back from Altium is a mask-only pad again. A mask opening read the other way round is turned with a note, and one that cannot fit the copper is left out with a note. The silkscreen and courtyard now clear the thermal land drawn, not the package's smaller pad. A maker's thermal land that reaches the lead pads (OPA569DWP: TI's "Minimum Area" copper of 7.59 x 12.95 mm runs 0.17 mm into the SOIC-20W lead pads) is still held, and the hold now says so (or, when the land would fit turned, that it was likely read the other way round). The reader's schema changed, so answers saved before are read again on the next live run.
  • [datasheet] web_search = true (off by default): when no link, part source or folder file gives a part's datasheet, one Claude web search asks for the maker's current PDF; each link found is downloaded and kept only if it names the part, the cost counts toward max_cost_usd, and the link is remembered so the part is not searched again. See docs/librarian.md.
  • A datasheet link that answers 200 with an empty page counts as refused, so the browser-headers and Chrome-fingerprint ways are tried (infineon.com gives a script nothing; the 2ED21824S06J PDF downloads the second way).
  • The datasheet reader can give a maker's land whose pin 1 pad is drawn another size (land.pin1_length / land.pin1_width: onsemi's WDFN8 pin 1 0.88 mm long where the others are 0.78, Nexperia's SOT143B pin 1 1.0 mm wide where the others are 0.6), and the footprint draws pin 1 that size, keeping the row's outer end and its lead's centre line, as KiCad does. Before, NCP4308AMT and BCV61 came out with every pad the same. The reader's schema changed, so answers saved before are read again on the next live run. The kicad-v1 errata gain a pad renumbering for AH1806-W (reference.renumber): Diodes' SC59 has pin 2 alone on one side, where KiCad's SOT-23 numbering puts pin 3, so a footprint built the datasheet's way is scored right.
  • Part descriptions say what the part is, never which tool made the file. A part with an LCSC number gets LCSC's own description of it (a JLCPCB parts search for that number), e.g. "-20℃~+70℃ 16MHz 20pF ±10ppm ±30ppm HC-49S-SMD-2P-Mini Crystals ROHS" for C2975360, which was "Crystals, CRYSTAL-SMD_L7.0-W4.0-LS7.8" (EasyEDA's tag and footprint name). The part search's text comes before EasyEDA's own, a shared Resistor / Capacitor symbol's "Resistor" is no longer the part's description, and nothing is made up from the category and package ("IC, C2975360" for a crystal): a resistor, capacitor or inductor no source described is described from its own BOM line ("RES 10kΩ 1% 0603"), any other part without source text is held for its Description. Footprints and symbols lose "generated by ecadlib (prototype - review before use)", "converted by ecadlib.easyeda_convert" and "read from the datasheet by ecadlib.datasheet"; a converted EasyEDA footprint is described from its package ("CRYSTAL-SMD, 7.0 x 4.0 mm body, 2 pads") and keeps EasyEDA's credit in a Credit field. Only a KiCad-library footprint names its source in the description, with its CC-BY-SA 4.0 label. Parts already released keep their text until they are built again (--refresh, or added again from the menu).
  • EasyEDA / LCSC parts get EasyEDA's own 3D model: the STEP file the footprint names is downloaded, placed on the footprint (its rotation, centre and board side), embedded in the PcbLib and gives the body height, so LCSC parts such as the YXC crystal X322512MSB4SI are no longer held for "no 3D height". A model that looks turned or off the pads is flagged for review; the footprint records easyeda:<uuid> with EasyEDA's credit. If the download fails, the generated model or box is used as before.
  • A missing or out-of-range 3D height is a note to check, not a hold: the part goes into the library and the Altium dialog says to check its 3D body. [release] height = "hold" brings the hold back.
  • Release anyway in the Altium dialog: a held part (other than a missing file or a change waiting for approval) can be released from the ecadlib popup. It shows why the part is held, asks why it is fine, and releases it like the review queue (release-check --allow with your name and reason, revision 1 in the change-control ledger), then puts it into the library.
  • Datasheet downloads get past makers' sites that refuse scripts (analog.com, Nexperia). When ecadlib's own request is refused (403, 429, 503, a bot-check page, a dropped connection, a TLS or certificate error; never a 404 or a host that never answers), it tries a desktop browser's headers, then Chrome's TLS fingerprint (curl_cffi), then a headless Edge or Chrome (Playwright) in a fresh profile that does not say it is driven by a script, and last, in a run someone is watching, opens the link in your own browser and takes the PDF from your Downloads folder. On by default ([datasheet] download, handoff, handoff_wait_s, downloads_folder); pip install "ecadlib[browser]" adds the two optional tools. Nothing solves a CAPTCHA, signs in or reads your browser's cookies. The cached PDF records the way that got it (via), as does ecadlib eval run, which never hands off.
  • [datasheet] folder: a folder of datasheet PDFs you downloaded by hand, for makers' sites that refuse scripts and for BOM lines with no link (#129). A file named for the part (<MPN>.pdf, or the MPN then a separator) is read before any link. A family datasheet (LTM4671.pdf for LTM4671IY#PBF) is read only when no link gave a PDF, and a file named for another part number (BAT54S.pdf for BAT54) only when no link gave a PDF here and your browser got none either (before a refused link is left to the API to fetch); both hold the part until a person confirms the file. The part keeps its public link, and only the file's name is recorded. A refused download now says to save the PDF there as <MPN>.pdf (- for a character no file name can hold, as in LM1117MPX-3.3/NOPB), says how to set the folder when none is, and first names a file already there that is not a PDF. A folder that does not exist or cannot be read is named in the review and in what was tried, the links are tried as ever, and ecadlib doctor warns about it. [datasheet] standard_land (default off) uses the checked standard land when a read's pin count, pitch, body and exposed pad fit exactly one standard package (auto: only when the read left a number blank or the datasheet prints no land). ecadlib eval run --datasheets DIR reads a benchmark's hand-downloaded PDFs and gives the pass rate without them.
  • Change control (#105): no library update can silently change a released part. Every writer (librarian re-runs, `upstre...
Read more

ecadlib 0.3.1

Choose a tag to compare

@oliBrowne oliBrowne released this 17 Oct 19:36
d12b395

Added

  • Altium builds the libraries itself (ecadlib/altium_native.py, docs/altium-native.md): every .PcbLib / .SchLib ecadlib writes gets a .ecadbuild recipe, and a DelphiScript (ecadlib_build.pas) rebuilds them inside Altium with its own object API; ecadlib altium-native write|compare and a Rebuild with Altium step in altium-pkg (--no-native-build to skip). compare reads Altium's result back pad by pad and pin by pin.
  • The ecadlib menu in Altium lets Altium build the library files itself before it reinstalls the library: each job copies the parts' build recipes into the library folder and writes ecadlib_build.txt, and the menu calls BuildLibraries (ecadlib_build.pas, now part of the menu's script project). The dialog says when a library failed to build. native_build=0 in ecadlib_menu.ini turns it off.
  • Altium footprints carry the designator on the assembly drawing too: KiCad's ${REFERENCE} on F.Fab becomes a .Designator on Mechanical 13 (the [layers] assembly layer), and footprints without one get it centred on the body. ecadlib parity and the footprint check compare it between KiCad and Altium (#37).
  • Edits made in Altium are kept: each library ecadlib copies into a library folder gets a .ecadstate (the hash of ecadlib's file and of the file Altium built from it). A library someone changed in Altium afterwards is no longer rebuilt by the native build or replaced by dblib-sync / altium-pkg; they report it instead (dblib-sync --overwrite-edits, altium-native write --rebuild-all replace it). Libraries Altium already built and ecadlib has not changed are not rebuilt on every run.
  • ecadlib fp-edit PLAN --part P show|rename OLD=NEW|same-net A,B|undo: fix a held part's datasheet pad table by hand, e.g. a connector whose pads are named 1+ / 1- or T / R / S (a footprint still needs a pad 1 or A1, so a person picks it). The edit is kept in footprint_edits.json next to the plan, applied whenever the librarian builds the part, and noted on the part with who made it. A part held because its datasheet pad table failed the check now says which check failed and what to do (no pad 1: rename a pad with fp-edit; pads of two nets overlap: same-net if they are one net, else pick a footprint), instead of "there is no footprint yet".
  • ecadlib sources-check and a weekly sources-canary workflow: checks the unofficial EasyEDA / JLCPCB endpoints against known parts.

Changed

  • Pads on one net may overlap in a datasheet pad table: pads whose pins share a name in the pin table (VIN on pins 1, 2 and the paddle) are put in same_net automatically (NC / DNC pins never are). An exposed pad listed twice at the same place with another size (for its thermal vias) is one pad, not a misread; an exact copy is still an error. The accuracy gate's baseline moves to 328/331 (qfn-DAC60504).

  • Official part APIs first: the default provider order is Nexar, DigiKey, Mouser, then the unofficial JLCPCB search and EasyEDA. Nexar / DigiKey / Mouser answers now give the LCSC number and datasheet link. [providers] unofficial = false turns the unofficial endpoints off completely.

  • Altium (Altium 365 first) and KiCad are the supported targets. The Fusion Electronics / EAGLE and EasyEDA Pro exports are marked experimental in the README and ecadlib -h: they keep working but get no new features and may be removed later.

Fixed

  • BOM intake: C1~C4 designator ranges are counted; European decimal quantities are not multiplied by ten; one cp1252 byte no longer garbles a UTF-8 CSV; DNP / DNF in the Value or MPN cell marks the line; a quantity-only footer row is not a part; an MPN that Excel turned into scientific notation is flagged.
  • DbLib table: parts go to the right table (LCSC long descriptions, easyeda:C7593 is an LCSC number, an IC package outranks the description words, menu parts follow their source).
  • Altium: variants per channel and part, variant alternates by Design Item ID, the encoding of a DbLib Altium saved is kept, prune removes the STEP files ecadlib wrote, sheet name case, menu jobs and pin numbers; the native build keeps recipe footprint names as stored and keeps a library when a STEP file is missing.
  • KiCad export: re-export touches nothing unchanged and never loses hand edits; Altium keep-outs and non-copper regions are not written as copper; Bottom Paste / Bottom Solder and fill rotation are kept; KiCad name clashes are reported; a database row never points at another part's symbol.
  • 3D models: the STEP model is turned to the footprint's pads, and more EasyEDA / LCSC package names get the right body.
  • House style: style learn needs coverage before a setting is high and does not write low settings; power_side = "left" puts a lone ground at the bottom.
  • Standard parts refuse land variants, exposed-pad SOTs and contradicting size codes.
  • The approval gate works under house parameter names, and placeholder MPNs are handled.
  • Models: the feedback turn is capped, API keys are redacted, unit repair is strict, configured key names are used.
  • Altium: DbLib table names Altium's database driver can open, install scripts written in cp1252, and a warning for Unicode pin names.
  • Team server: no self-approval through the plan approval route, and an odd sign_as is a plain 400.
  • Security: no API key in network error messages, framing refused in local mode, a deeply nested JSON body is a plain 400.

ecadlib 0.3.0

Choose a tag to compare

@oliBrowne oliBrowne released this 17 Oct 07:54
45071fe

Added

  • KiCad: the ecadlib window in the PCB editor (ecadlib/assets/kicad_action_plugin.py, ecadlib/kicad_menu.py): an ecadlib button in the top toolbar and Tools > External Plugins entries open a dark window like the Altium dialog with Add part from MPN (live lookup, then the footprint placed), Check project BOM (counts per kind, Later / Fill the library now, the report on request) and Open review queue; it does not block KiCad. ecadlib kicad-menu run-job does the work with the Altium menu's actions and a KiCad library as the target; ecadlib kicad-menu check-bom "%I" hooks into the schematic editor's Generate BOM. The plugin package (kicad-pcm --plugin, setup page's Add to KiCad) gains the toolbar icon. Fixed: the plugin ran ecadlib in the project folder, where python -m ecadlib imported the project's ecadlib/ library folder. Tried in KiCad 7.0.11.
  • Altium menu: the ecadlib dialog (ecadlib/altium_forms.py, ecadlib_dialog.pas + .dfm): Check project BOM, Add part from MPN and Fill the library run in one dark dialog like Altium's own, with the live lookup, a progress line, a count with one row per kind and Later / Fill the library now, then reinstall the library; no browser unless a part needs a person (review queue) or you ask for the full report. run-job writes progress.ini and the result's big / row1.. lines and has an open action for reports in the workspace. dialogs=0 keeps the plain message boxes. Run in Altium Designer 26.10 on a real PC.
  • Symbol house rule for every IC (symbol_layout, [symbols] power_side): inputs left, outputs right, power on top, ground on the bottom ("top", the default), or the top and bottom edges empty with power at the top of the left side and ground at its bottom ("left"). Applies from 1 pin (layout_pins default was 40), to EasyEDA IC symbols, and to KiCad library symbols whose pin text would overlap in Altium. New groups other_in / other_out from names (IN+, TRIG, THRES, FB / OUT, Q, DISCH, PGOOD, SW) and pin types, other for pins with no direction (moved between sides to keep the body square); power_out (VOUT, VCAP) now goes right. symbol_layout.text_problems finds pin names or numbers that overlap or run out of the body; check and ecadlib symbol report them. Found on the NE555DR from EasyEDA in Altium, whose VCC / RST / GND names ran into the side pin names.
  • fp_tidy.py: converted EasyEDA footprints are tidied to the rule book: the reference on silk above the part and ${REFERENCE} on fab, rounded-rectangle SMD pads (copper size and place unchanged), silk under the body removed, a pin-1 dot beside pad 1 when silk shows none, the fab pin-1 corner chamfered, the value moved below the part, silk specks and doubled segments removed, silk widths set to 0.12 mm and an outline that crowds a pad row pulled in to 0.2 mm clearance. Each change is noted on the part. The EasyEDA converter now keeps silk arcs (pin-1 notches) and draws the body region (layer 99) as the fab outline.
  • Symbols: a dual or quad part's pins go one channel at a time (1IN-, 1IN+, 2IN-, 2IN+).
  • Librarian: a converted footprint is named after its .kicad_mod file (EasyEDA's package name made the rule book report "footprint name is not its file name"), and an LCSC number ecadlib found itself fills Supplier 1 / Supplier Part Number 1 and the LCSC link, as one from the BOM does.
  • ecadlib eagle-export (eagle_export.py) and ecadlib easyeda-export (easyeda_pro_export.py): the library as an Autodesk Fusion Electronics / EAGLE .lbr and an EasyEDA Pro .elibz (symbols, footprints, devices with their fields; STEP models beside them), built from kicad-export. Every footprint is read back and compared pad by pad with its KiCad original, mask and paste also as layer areas, symbols pin by pin, and through KiCad's own importers where pcbnew is found. Release-check rules [release] eagle / easyeda (hold / warn / off, default warn), web UI buttons, POST /api/export/tool, Workspace and MCP tool_export. Surveyed on 1,927 KiCad library footprints; tests/test_tool_exports.py. Each export writes INSTALL.md (import steps, STEP model per footprint, differences) and one hand-off zip; the web UI and MCP return it; Fusion parts carry Fusion's standard attributes (PACKAGE, CATEGORY_L1/L2, VENDOR/VPN) and passives a user value; ecadlib testpack exports both with a checklist section for each tool. Pin name / number visibility is carried and compared (resistor and capacitor pins were read as hidden).
  • Your library across tools (ecadlib/hub.py): a Your library page in the web UI (shortcut l), ecadlib hub, Workspace hub / hub_part / hub_fix / hub_build_bom, GET /api/hub, GET /api/hub/part, POST /api/hub/fix (librarian), MCP library_hub / library_hub_part. Every part once, from your libraries (--lib and [hub] libraries: .SchLib, .PcbLib, .DbLib, .kicad_sym, .pretty, .kicad_dbl, Altium 365 lists) and ecadlib's plans, with a cell per tool (Altium, Altium 365, KiCad, Fusion, EasyEDA): missing, same, different or behind, compared on pads, pins and value. Last changed and by whom per part and per copy (git commit, Altium 365 revision, file date plus the web-app action), history of added / changed / removed copies in <workspace>/hub/history.jsonl, a part page with footprint pictures, pinout sketch, sources, release check, sign-off, where-used ([hub] projects), lifecycle and history, and fix buttons (make the KiCad version, Altium 365 dry run, build a library-only part with ecadlib). hub.register_tool() lets other tools' readers fill their columns. New [hub] rules section. The page opens on a tile per tool (parts, libraries, last change and by whom, what it lacks) that shows your library as it is in that tool, next to Compare all. Parts copy between Altium and KiCad (POST /api/hub/copy, librarian; ecadlib hub --copy-to; MCP library_hub_copy) into <workspace>/hub/library, and into a KiCad or Altium project from [hub] projects (its lib tables or .PrjPcb), with a Project filter using KiCad and Altium where-used.
  • Web UI, more fluid and human-friendly: first-visit welcome with Try it with a sample BOM (POST /api/demo) and the setup check; drop a BOM anywhere; live per-part progress lines and a Stop button for long jobs (POST /api/job/cancel); parts as cards with a footprint picture and chips (status, cross-check, KiCad / Altium, cost and model); a side panel per part with the held reason and next step in plain words (ecadlib/messages.py), both values of a disagreement and the datasheet page; Undo for approve / reject / release anyway; search, filters, keyboard shortcuts (?); skip link, labels, contrast checked in both themes, reduced motion. ecadlib/partview.py, Workspace library_parts / demo_bom, GET /api/parts, MCP library_parts.
  • The terminal, human-friendly (ecadlib/term.py): one status vocabulary (✓ ready, ! held, ○ waiting for sign-off), colour and symbols only on a terminal (never with NO_COLOR, --json or in CI), tables that fit the width, a summary block with what was written and the next commands, a live progress line for librarian, "waiting on X (12 s)" for slow network sources and model calls, and -q / -v on every command; used by demo, init, doctor, librarian, triage, release-check, status, kicad-export, dblib-sync, altium-pkg, parity, eval gate, migrate, rebuild, agent status, queue list. New ecadlib review: held parts one at a time with the reason in plain words; pick a candidate, release anyway or open the datasheet (never asks with --yes or when piped). --json output is unchanged; ecadlib agent status prints a summary and takes --json for the old JSON.
  • One voice for everything people read (docs/ui-voice.md, ecadlib/messages.py): every held reason (release check, footprint check, KiCad/Altium match, cross-check, datasheet reader, standard parts, sign-off, library agent) has a code, a plain sentence and a next step (messages.held(code, **values), messages.explain(raw_reason)); plans and --json keep their machine strings. Reports rewritten outcome first, grouped by what to do: review.md plus a new review.html (web UI look, light/dark), release_check.md, datasheet *.review.md, parity, eval report.md, test pack CHECKLIST.md, agent PR body and notifications, ecadlib doctor, Altium menu and KiCad plugin dialogs, init questions, MCP errors. Workspace librarian_run rows gain word/says, held_parts gains reasons; kicad-export skipped entries gain says. Tests: tests/test_messages.py (a new reason without a sentence fails), tests/test_ui_voice.py (snapshots, no internal names or absolute paths).
  • ecadlib style (house_style.py): teach ecadlib your house style. learn --from DIR learns description patterns, value formats, common parameters, active-low pin notation and example parts on top of what init infers, and writes house_style.json. direct "TEXT" adds written direction. learn --ai has any configured model ([style], else [ai]) write a guide and turn the direction into validated ecadlib.toml settings (--write-rules). The librarian adapts new parts by code when a profile exists ([style] apply = "auto"|"off"). check / apply [--ai] work on a plan; a model's rewording is rejected when it adds a number, and identity fields are never shown. Help scales with the model's tier. export-dataset writes chat-format JSONL for fine-tuning your own model. UI card, Workspace methods, MCP tools learn_house_style, house_style, check_house_style, apply_house_style. Guide: docs/house-style.md.
  • Footprint rule book (docs/footprint-rulebook.md, ecadlib/footprint_rules.py): what a footprint must contain and look like, drawn from KLC F1-F9, KiCad's official library, IPC-7351 naming, Altium's IPC wizard layer conventions and Bogatin's public guidance. New rules `nam...
Read more