11.1.9.5. Library

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:

spice_library['1N4148']
EXTENSIONS = ('.lib', '.mod', '.lib@xyce', '.mod@xyce')
models

Dictionary of models

subcircuits

Dictionary of sub-circuits