class PySpice.Spice.Library.SpiceLibrary(root_path)[source]

Bases: object

This class implements a Spice sub-circuits and models library.

A library is a directory which is recursively scanned for ‘.lib’ file and parsed for sub-circuit and models definitions.

Example of usage:

spice_library = SpiceLibrary('/some/path/')

If the directory hierarchy contains a file that define a 1N4148 sub-circuit then we can retrieve the file path using:

property models

Dictionary of models

property subcircuits

Dictionary of sub-circuits