kicad2ems.ipc.netclass

Net classes and the impedance each one asks for (no Qt here).

    nc = NetClasses.from_project('board.kicad_pro', nets)
        # the classes of the project file (KiCad 7 and later)
    nc = NetClasses({net: ['50R_SE'], ...}, nets)
        # the classes KiCad reports through its API
    nc.of(net)  # 'Default', '100ohm', ...: the net's class (the first of
                # several, KiCad 9+)
    nc.target(net)  # (100.0, 'diff') / (50.0, 'se') / None
    nc.disabled(net)  # True for anything #PWR: never mapped

The target comes from the class name: a number with ohm / Ohm / R / Ω after it,
or Z before it ('50R_SE', '100ohm_diff', 'Z90 DIFF', '50 Ohm'). SE / single in
the name make it single-ended, diff / dp / differential differential. A name
that says neither ('100ohm', as KiCad's CM5 demo names its classes) is
differential when the class holds a pair (a net whose partner, by KiCad's rule:
the name ending in + / - or P / N, is on the board), and single-ended otherwise;
in a differential class the nets that are not a pair's legs (a class pattern
caught them too) get no target. Nets or classes with #pwr in their names
(KiCad's power symbols) are disabled.
kicad2ems.ipc.netclass.parse_target(name)[source]
(ohm, 'se' | 'diff' | None) of a class name, or None when it names no
impedance.
kicad2ems.ipc.netclass.partner(net)[source]
The other leg of a differential pair, by KiCad's rule (the name ends in +
/ - or P / N), or None.