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.1.0.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.1.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: netlist_viewer-0.1.0.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.1.0.tar.gz
Algorithm Hash digest
SHA256 52f765e0f8814c60df0e6202918067bea0f34f35a0fe4a20dc33c12ff382ee79
MD5 6c0505123759b50cde4539ed8471f5e6
BLAKE2b-256 f4b071bb46b5cf0f06f08a5197a1dce123c11bf5f20a257305087761590133ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: netlist_viewer-0.1.0-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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb4a6b2662edac4a625f88dce0586e26f883f19ad48c4507997afb0636011494
MD5 16f93f1506799dada16ed853ba228607
BLAKE2b-256 334fc208957574c05cd5aad945877a21d58ea385b26ef2b521765ebad96fad9a

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