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.2.tar.gz (16.1 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.2-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: netlist_viewer-0.1.2.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","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.2.tar.gz
Algorithm Hash digest
SHA256 df26ef15c85fac0a195e0147bbce6a9aacb6172d86e9f59a125dfa84f023857c
MD5 f229152bfa40d81ba3dd5a52ab63bb8e
BLAKE2b-256 66663ad58448552eb0535194c78a19ee1875650b262e9d1f93d297cbfd049699

See more details on using hashes here.

File details

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

File metadata

  • Download URL: netlist_viewer-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 876839d5116334c2f7471fe74ad92b0353a0b33f498b7ad4611da0b95570ee55
MD5 43285f4274a86979574180f607a5d051
BLAKE2b-256 f2b612e70a20f76f0b88956977791c5090fffd3f50171065b4e5b4fadcb59e6e

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