skidl.schematic_netlist module

Generic, hierarchical netlist emitter for schematic generation.

SKiDL’s job is to describe electrical interconnection. The graphical work of turning that interconnection into a schematic (placement, routing, KiCad file generation) is done by a separate tool. The bridge between the two is the JSON document produced here by build_generic_netlist().

The document is deliberately tool-neutral and easy to extend:

  • Component symbol geometry is embedded (one definition per unique lib_id), so the downstream tool needs no access to KiCad symbol libraries and the result is fully reproducible.

  • Orientation/layout hints the downstream placer consumes are carried alongside the electrical data: per-component symtx (mirror/rotate) and per-net stub/netio. New hints can be added as new keys without breaking readers.

Coordinates are emitted in native KiCad units (mm) and integer degrees; the downstream tool performs the mm->mils and degrees->direction normalization (the equivalent of preprocess_circuit in the current KiCad backends).

skidl.schematic_netlist.build_generic_netlist(circuit, title='', top_name='')[source]

Build a generic, hierarchical netlist document from a circuit.

Parameters:
  • circuit (Circuit) – The circuit to serialize. It should already be merged (merge_net_names/merge_nets) as generate_schematic does before calling this.

  • title (str) – Optional schematic title carried through to the tool.

  • top_name (str) – Optional top-of-hierarchy name for output filenames.

Returns:

A JSON-serializable document with symbols, components, nets and sheets sections. The structure is stable and additive; readers should ignore unknown keys.

Return type:

dict