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.3.tar.gz (19.4 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.3-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: netlist_viewer-0.1.3.tar.gz
  • Upload date:
  • Size: 19.4 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.3.tar.gz
Algorithm Hash digest
SHA256 35d4373bdbb42671da43eb07180f5100c4af947cf864c5558a8db7139d25b7bb
MD5 072134ce7c4fa173effa7aeb5cd28ed0
BLAKE2b-256 f31f096a3b39138458ec6f21875a235e1c70418c06079afb68f4863378d0e532

See more details on using hashes here.

File details

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

File metadata

  • Download URL: netlist_viewer-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 23.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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 53fa3a14838bbe3a3ff666a745c7a7ab0dfe16f4e4f19543cc3548a8d4934e1b
MD5 ab685636c64a9aa2fc12d7bc18fc4e33
BLAKE2b-256 1411e7f6b85d221a0bb6f203a7dc10257adf2c20a12b5a43c20c3d6eb29a6e7a

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