Skip to main content

Visualize SPICE netlists as interactive circuit diagrams

Project description

netlist_viewer

Visualize SPICE netlists as interactive circuit diagrams.

netlist_viewer parses SPICE netlist files and renders them as schematic diagrams using automatic graph layout. Built with NetworkX for layout algorithms and PySide6 (Qt) for the GUI.

Installation

pip install netlist_viewer

Requires Python 3.13+.

Usage

Command Line

netlist_viewer path/to/circuit.spice

or, using uv:

uvx netlist_viewer path/to/circuit.spice

Options:

  • -v, --verbose — Enable verbose logging

From Python

from netlist_viewer.spice_parser import SpiceParser
from netlist_viewer.layout import add_spring_locations
from netlist_viewer.gui.main import open_ui

netlist_text = """
V1 in 0 AC 1
R1 in mid 100
L1 mid out 10m
C1 out 0 1u
"""

parser = SpiceParser()
netlist = parser.parse(netlist_text)
placed = add_spring_locations(netlist)
open_ui(placed)

Controls

Input Action
Left click Select component
Right drag Pan view
Scroll wheel Zoom in/out
R Rotate selected component 90 degrees
Ctrl+O Open file

Supported SPICE Primitives

Prefix Component Terminals
R Resistor 2
C Capacitor 2
L Inductor 2
D Diode 2
Q BJT 3 (C, B, E)
M MOSFET 4 (D, G, S, B)
J JFET 3 (D, G, S)
V Voltage Source 2
I Current Source 2
X Subcircuit Variable

Subcircuits (.SUBCKT / .ENDS) are supported and rendered as labeled boxes.

Development

# Install dev dependencies
uv sync

# Run tests
uv run pytest

# Run type checker
uv run ty check

# Run linter
uv run ruff check

# Run the viewer with a sample netlist
uv run main.py

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

netlist_viewer-0.0.1.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

netlist_viewer-0.0.1-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file netlist_viewer-0.0.1.tar.gz.

File metadata

  • Download URL: netlist_viewer-0.0.1.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for netlist_viewer-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0026a8305177131b360ec44f98428331f24687f1d76b8ec37a25fbeaad60b374
MD5 17fb71a6e7f96500645e5550155f7167
BLAKE2b-256 493aec63a59f1df7d78fd522e56d4037977ea1d90d03b43358ace6e8a9e5bc95

See more details on using hashes here.

File details

Details for the file netlist_viewer-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: netlist_viewer-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for netlist_viewer-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b6c3ceab065156fa91b1beb82aed20b59dd1e5ad2fa3a179651e6938c03f32cf
MD5 5b4c2ffcd7eac4006cce26f531e5cdca
BLAKE2b-256 2cc448f0bdb4d217466a62cddd9cd8b2dc2d4e7602ce5143c0540a39baa29424

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