schematizer
Turn a generic, hierarchical netlist (JSON) into a KiCad schematic or an SVG drawing of one.
schematizer does the graphical half of EDA: it takes a tool-neutral netlist
document and does all the drawing work — component placement, wire routing, and
writing either editable .kicad_sch files or static, cross-linked .svg pages
for a selected KiCad version (6–10). It is not tied to any particular front end: any tool that emits the netlist format can use
it. SKiDL is the first such producer —
SKiDL describes electrical interconnection in code and hands the netlist to
schematizer — but the input is just JSON, so other generators work too.
The netlist document (produced by
skidl.schematic_netlist.build_generic_netlist, or any equivalent emitter)
embeds each component's symbol definition and carries layout hints —
component mirror/rotate (symtx) and net stubbing (stub/netio). Because
symbols are embedded, this tool needs no access to KiCad symbol libraries.
Install
pip install schematizer
Command-line use
# netlist.json -> KiCad 9 schematic files in ./out/
schematizer netlist.json --tool kicad9 -o out --top-name mydesign
# ...or a set of linked SVG pages instead
schematizer netlist.json --tool kicad9 -o out --top-name mydesign --format svg
Library use
import json
from schematizer import render
with open("netlist.json") as f:
netlist = json.load(f)
render(netlist, tool="kicad9", filepath="out", top_name="mydesign")
render(netlist, tool="kicad9", filepath="out", format="svg")
render() also accepts a path to the JSON file directly.
How it fits with SKiDL
To the SKiDL end user nothing changes: Circuit.generate_schematic() and
Circuit.generate_svg() build the generic netlist internally and call render()
here (with format="kicad" and format="svg" respectively). Because the seam is a
plain JSON document, schematizer can be iterated and improved independently of
SKiDL — and reused by any other front end that emits the same format.
Status
Self-contained. The placement/routing/writer engine is vendored under
schematizer/engine, and the netlist is reconstructed into a lightweight
intermediate representation (schematizer.ir: SchPart/SchPin/SchNet) that
the engine consumes directly — no .kicad_sym re-parse, no KiCad library
access, and no runtime dependency on skidl. The only runtime dependency is
simp_sexp. The KiCad power-symbol library (for GND/rail nets) is vendored in
schematizer/data.
Output formats
--format kicad (the default) writes editable .kicad_sch files.
--format svg writes static .svg pages instead:
schematizer netlist.json --tool kicad9 --format svg -o out
Both come off the same placement and routing pass and differ only in the final
serialization, so an SVG page has the layout of the .kicad_sch it would have
produced. Symbols are drawn from the graphics embedded in the netlist, so SVG
output needs no KiCad libraries either.
--flatness controls hierarchy for both formats. At 0.0 (the default) every
subcircuit gets its own page; in the SVG output a child appears on its parent's
page as a hyperlinked rectangle, and each child page carries links back to
its parent and to the top sheet, so a hierarchical design can be clicked
through in a browser. At 1.0 everything collapses onto one page, and values
in between flatten only the smaller subcircuits.
Each SVG page is sized to its drawing rather than to an A-size sheet, since an SVG renders at whatever size it declares.
Labels-only mode
mode="labels" (CLI: --mode labels) writes a schematic whose connectivity is
exact by construction, for flows where correctness matters more than a
readable drawing (for example, as the input to a PCB layout flow):
- Parts are placed unrotated on a plain, deterministic grid. There is no placement optimization and no wire routing, so it is fast (about 2 s for a 190-part design).
- Every connected pin gets a short wire stub ending in a power symbol (if the net name matches a KiCad power symbol), a global label (net on more than one sheet) or a local label (net on one sheet). Pins on the no-connect net get a no-connect flag.
- Each subcircuit with parts becomes a sheet directly under the root sheet (nested subcircuits become sibling sheets).
schematizer netlist.json --tool kicad10 --mode labels -o out --top-name mydesign
KiCad output only; format="svg" is rejected in this mode. KiCad leaves #
references (power symbols, PWR_FLAGs) out of its exported netlists, so compare
connectivity without them.
Optional netlist keys
These keys are additive (the schema stays at version 1, and readers ignore keys they don't use):
components[].fields: user part fields such asMPN; written as symbol properties.nets[].attrs: per-net attributes for layout tools, e.g.{"netclasses": ["Power"]}.netclasses: net class definitions referenced bynets[].attrs.- A net with
"nc": trueis the no-connect net; its pins get no-connect flags.
Randomized layout
Placement starts parts at random positions and the router breaks ties randomly, so the same netlist produces a different — equally valid — drawing on every run. There is no way to pin a layout down: if you get one you want to keep, keep the generated files.
Supported KiCad versions
--tool accepts kicad6 … kicad10, which share one modern S-expression
writer (with a couple of KiCad-8 format toggles). The version still matters for
--format svg, because the embedded symbol graphics are KiCad-version flavored.
KiCad 5 is not supported and is rejected with an explanatory error. It
needs the legacy EESCHEMA .sch format rather than .kicad_sch, and KiCad 5
libraries describe symbols in a different, non-s-expression form that the
generic netlist does not carry.
Metadata
Release files for schematizer 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| schematizer-0.2.0.tar.gz | 158.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| schematizer-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 318.5 kB
Release files / schematizer-0.2.0.tar.gz
| Download URL | schematizer-0.2.0.tar.gz |
|---|---|
| Size | 158.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d82d3b70d88ffa10dacdb35b1142781145a500caff909eaad3827fd1d3028424
|
|
BLAKE2b-256 checksum How to use checksums |
19188820538c3236df87039f97823a3add80cbae1a43f1b8c5372d6a2af31d9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / schematizer-0.2.0-py3-none-any.whl
| Download URL | schematizer-0.2.0-py3-none-any.whl |
|---|---|
| Size | 160.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d435486a5cfb4ac85788a2d6d988efcd5ca9e8c600a6c8c03e8f919f3b94614
|
|
BLAKE2b-256 checksum How to use checksums |
79615efe9637e063887d09d3baaf01f37437fd49271063c5528d4eca33a31656
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|