skidl.skidl module

skidl.skidl.ERC(*args, **kwargs)

Run class-wide and local ERC functions on this circuit.

skidl.skidl.backup_parts()

Saves parts in circuit as a SKiDL library in a file.

Parameters:

file – Either a file object that can be written to, or a string containing a file name, or None. If None, a standard library file will be used.

Returns:

Nothing.

skidl.skidl.empty_footprint_handler(part)

Handle the situation of a Part with no footprint when generating netlist/PCB.

Parameters:

part (Part) – The part with no footprint.

Note

By default, this function logs an error message if the footprint is missing. Override this function if you want to try and set some default footprint for particular types of parts (such as using an 0805 footprint for a resistor).

skidl.skidl.erc_assert(fail_msg='FAILED', severity=ERROR)

Add an ERC assertion to a class or class instance.

skidl.skidl.generate_graph(engine='neato', rankdir='LR', part_shape='rectangle', net_shape='point', splines=None, show_values=True, show_anon=False, split_nets=['GND'], split_parts_ref=[])

Returns a graphviz graph as graphviz object and can also write it to a file/stream. When used in ipython the graphviz object will drawn as an SVG in the output.

See https://graphviz.readthedocs.io/en/stable/ and http://graphviz.org/doc/info/attrs.html

Parameters:
  • file – A string containing a file name, or None.

  • engine – See graphviz documentation

  • rankdir – See graphviz documentation

  • part_shape – Shape of the part nodes

  • net_shape – Shape of the net nodes

  • splines – Style for the edges, try ‘ortho’ for a schematic like feel

  • show_values – Show values as external labels on part nodes

  • show_anon – Show anonymous net names

  • split_nets – splits up the plot for the given list of net names

  • split_parts_ref – splits up the plot for all pins for the given list of part refs

Returns:

graphviz.Digraph

skidl.skidl.generate_netlist(**kwargs)

Return a netlist and also write it to a file/stream.

Parameters:
  • file – Either a file object that can be written to, or a string containing a file name, or None.

  • tool – The EDA tool the netlist will be generated for.

  • do_backup – If true, create a library with all the parts in the circuit.

Returns:

A netlist.

skidl.skidl.generate_pcb(**kwargs)

Create a PCB file from the circuit.

Parameters:
  • file – Either a file object that can be written to, or a string containing a file name, or None.

  • tool – The EDA tool the netlist will be generated for.

  • do_backup – If true, create a library with all the parts in the circuit.

  • fp_libs – List of directories containing footprint libraries.

Returns:

None.

skidl.skidl.generate_schematic(**kwargs)

Create a schematic from a Circuit.

skidl.skidl.generate_svg(tool=None, layout_options=None)

Create an SVG file displaying the circuit schematic and return the dictionary that can be displayed by netlistsvg.

Parameters:
  • file (_type_, optional) – Filename to store SVG. Defaults to None.

  • tool (_type_, optional) – Backend tool. Defaults to None.

  • layout_options (_type_, optional) – Options to control netlistsvg/ELK layout algorithm. Defaults to None.

Returns:

JSON dictionary for input to netlistsvg.

Return type:

dict

skidl.skidl.generate_xml(tool=None)

Return netlist as an XML string and also write it to a file/stream.

Parameters:
  • file – Either a file object that can be written to, or a string containing a file name, or None.

  • tool – Backend tool such as KICAD.

Returns:

A string containing the netlist.

skidl.skidl.get_default_tool()[source]

Get the ECAD tool that will be used by default.

skidl.skidl.reset()

Clear any circuitry and cached part libraries and start over.

skidl.skidl.set_default_tool(tool)[source]

Set the ECAD tool that will be used by default.