A pure-Python parser for SPICE, Spectre, CDL, and DSPF netlist files — extracts subcircuit, port, device, and parasitic data for EDA automation and library characterization workflows
Project description
eda-netlist-parser
A pure-Python parser for SPICE-family netlist files: .spi, .cir, .cdl, .scs, .spf, .sp, .hsp.
Installation
pip install eda-netlist-parser
# optional colored terminal output:
pip install eda-netlist-parser[color]
Quick start
from netlist_parser import NetlistParser, NetlistError
parser = NetlistParser()
try:
netlist = parser.parse("design.spi")
except NetlistError as e:
print(f"Error: {e}")
for cell in netlist.cells:
print(cell.name, cell.ports)
for inst in cell.instances:
print(" ", inst.name, inst.code, inst.device_name)
Importing
from netlist_parser import NetlistParser
from netlist_parser import NetlistParser, Netlist, NetlistCell, DeviceInstance
API
NetlistParser(internal=False)
| Method | Returns | Description |
|---|---|---|
parse(filename) |
Netlist |
Parse a single file |
read(path, data=None) |
varies | Parse file or directory |
read() data modes:
data= |
Returns |
|---|---|
None |
Netlist |
'cells' |
Set[str] |
'ports' |
Dict[str, List[str]] |
'devices' |
Dict[str, Set[str]] |
'device-params' |
Dict[str, Dict] |
'resistors' |
Dict[str, List] |
'capacitors' |
Dict[str, List] |
Classes
Netlist— full file data:.cells,.version,.resistance,.capacitance,.layer_mapNetlistCell— one subckt:.name,.ports,.instances,.substituteDeviceInstance— one line:.name,.code,.nodes,.device_name,.number,.parametersNetlistError— raised on file errors
CLI
netlist-parser sample.spi # summary
netlist-parser sample.spi --cells # list cell names
netlist-parser sample.spi --ports # cell → ports
netlist-parser sample.spi --devices # cell → device names
netlist-parser sample.spi --cell inv_x1 # one cell detail
netlist-parser --version
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eda_netlist_parser-0.1.1.tar.gz.
File metadata
- Download URL: eda_netlist_parser-0.1.1.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afc331140bfdc1e092540e720a9fbaae9280c69ed85e8ea7808f39a20714f485
|
|
| MD5 |
7af229c2461a9c0e86d370917bd8a0ca
|
|
| BLAKE2b-256 |
8d6f06acc59c8719cf6b208843ea395e78c1a6503d0e3a41df3d42994efc2b34
|
File details
Details for the file eda_netlist_parser-0.1.1-py3-none-any.whl.
File metadata
- Download URL: eda_netlist_parser-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbc2d5122e53828821c6092dbf8a9df93f824ead9703d2d22fe82ca20e46612b
|
|
| MD5 |
01c5f6b5b71b545f751f2ce58e224fc8
|
|
| BLAKE2b-256 |
975471d3b35cd8d6d59d2a867f8fd79229624bb769418fdff0239b7e202c49ff
|