Skip to main content

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.

CI Python License: MIT

Installation

pip install eda-netlist-parser
# optional colored terminal output:
pip install eda-netlist-parser[color]

PyPI Python

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_map
  • NetlistCell — one subckt: .name, .ports, .instances, .substitute
  • DeviceInstance — one line: .name, .code, .nodes, .device_name, .number, .parameters
  • NetlistError — 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

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eda_netlist_parser-0.1.1.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eda_netlist_parser-0.1.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

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

Hashes for eda_netlist_parser-0.1.1.tar.gz
Algorithm Hash digest
SHA256 afc331140bfdc1e092540e720a9fbaae9280c69ed85e8ea7808f39a20714f485
MD5 7af229c2461a9c0e86d370917bd8a0ca
BLAKE2b-256 8d6f06acc59c8719cf6b208843ea395e78c1a6503d0e3a41df3d42994efc2b34

See more details on using hashes here.

File details

Details for the file eda_netlist_parser-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for eda_netlist_parser-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fbc2d5122e53828821c6092dbf8a9df93f824ead9703d2d22fe82ca20e46612b
MD5 01c5f6b5b71b545f751f2ce58e224fc8
BLAKE2b-256 975471d3b35cd8d6d59d2a867f8fd79229624bb769418fdff0239b7e202c49ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page