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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netlist_viewer-0.1.1b1.tar.gz.
File metadata
- Download URL: netlist_viewer-0.1.1b1.tar.gz
- Upload date:
- Size: 16.0 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10420f10884fc6812d85b7a45b11358bef64da40f8894c66ed21cd82f012d39d
|
|
| MD5 |
5c47c6b45428ced4d692e8ec951ab615
|
|
| BLAKE2b-256 |
59fe7c82f99f2d68d8189421caf96e9938ea6b0ebc4867bc3edfe31ab86218cc
|
File details
Details for the file netlist_viewer-0.1.1b1-py3-none-any.whl.
File metadata
- Download URL: netlist_viewer-0.1.1b1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
520d7eb067c130ce912291316ff1c0be373ff6d2983de1a246ebf06e7381d13a
|
|
| MD5 |
550d6d40972dc18d394b1e92cd12aac4
|
|
| BLAKE2b-256 |
36585b3409e438638b04b023c98ae96389bd7373fdd2f55592cddd44523b5efe
|