PySpice
Simulate electronic circuit using Python and the Ngspice / Xyce simulators
Decision gist · record as of 2026-08-14
Yes, if you need to automate SPICE simulation in Python and can install Ngspice or Xyce separately. The package is stable and production-ready, but maintenance is dormant (last release 2021); it remains suitable for established workflows but may not receive fixes for new simulator versions or Python features. No known security vulnerabilities. GPLv3 copyleft applies—verify compatibility with your project's licensing.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Ngspice or Xyce simulator installed separately on your system; PySpice is a Python binding only and does not bundle the simulator itself.
- Low friction install with a pure-Python wheel.
- Maintenance is dormant—last release was in 2021 and no commits since August 2024—but the package remains stable and archived repository is not flagged as abandoned.
License · maintenance · safety
GPLv3 (copyleft) — Licensed under GPLv3 (copyleft). Any derivative work or modification must also be released under GPLv3; proprietary or closed-source projects cannot incorporate this package without releasing their own source code.
last release 2021-05-15 (1917 days) · last repo commit 2024-08-13 · 857 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 125,460 downloads/mo, #11,817 on PyPI
Alternatives
Verify before relying
pip install PySpice
from PySpice.Spice.Netlist import Circuit
from PySpice.Unit import *
circuit = Circuit('Simple RC')
circuit.V('input', 1, circuit.gnd, 1@u_V)
circuit.R(1, 1, 2, 1@u_kΩ)
circuit.C(1, 2, circuit.gnd, 1@u_uF)- Whether Ngspice/Xyce installation is straightforward on all supported platforms (Windows, Linux, macOS).
- Current compatibility with modern Ngspice/Xyce versions beyond those tested in 2021.
- Whether the dormant maintenance status affects real-world usability for new circuit designs.
What it is and what it does
PySpice is a Python module that bridges your code to the Ngspice and Xyce circuit simulators, letting you define electronic circuits using an object-oriented API instead of writing SPICE netlists by hand. It handles unit conversions, exports simulation results to NumPy arrays, and integrates with Matplotlib for plotting. The package includes a partial SPICE netlist parser, support for KiCad schematic integration, and bindings to Ngspice's shared library via CFFI.
You use PySpice when you want to automate circuit simulation, sweep parameters programmatically, or integrate circuit analysis into a larger Python workflow. It's aimed at engineers and students who prefer scripting over GUI-based simulators. The main dependencies are scientific libraries (NumPy, SciPy, Matplotlib) plus PyYAML and PLY for parsing.
Use it for
- Automate parametric sweeps and optimization loops for circuit designs without manual netlist editing.
- Generate circuit netlists from KiCad schematics and run simulations directly from Python.
- Integrate circuit simulation into a data analysis or machine-learning pipeline using NumPy and SciPy.
- Teach circuit analysis and simulation in an educational setting with interactive Python notebooks.
- Parse and programmatically modify existing SPICE netlists for batch processing or design exploration.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to automate SPICE simulation in Python and can install Ngspice or Xyce separately.
The package is stable and production-ready, but maintenance is dormant (last release 2021); it remains suitable for established workflows but may not receive fixes for new simulator versions or Python features. No known security vulnerabilities. GPLv3 copyleft applies—verify compatibility with your project's licensing.
Install
pyspice on PyPI
Before you install
Low friction install with a pure-Python wheel. Maintenance is dormant—last release was in 2021 and no commits since August 2024—but the package remains stable and archived repository is not flagged as abandoned.
Requires Ngspice or Xyce simulator installed separately on your system; PySpice is a Python binding only and does not bundle the simulator itself.
License in practice
Licensed under GPLv3 (copyleft). Any derivative work or modification must also be released under GPLv3; proprietary or closed-source projects cannot incorporate this package without releasing their own source code.
Quickstart
pip install PySpice
from PySpice.Spice.Netlist import Circuit
from PySpice.Unit import *
circuit = Circuit('Simple RC')
circuit.V('input', 1, circuit.gnd, 1@u_V)
circuit.R(1, 1, 2, 1@u_kΩ)
circuit.C(1, 2, circuit.gnd, 1@u_uF)
Verify before relying
- Whether Ngspice/Xyce installation is straightforward on all supported platforms (Windows, Linux, macOS).
- Current compatibility with modern Ngspice/Xyce versions beyond those tested in 2021.
- Whether the dormant maintenance status affects real-world usability for new circuit designs.
Package facts
| License | GPLv3 copyleft |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 7 packagesPyYAMLcffimatplotlibnumpyplyscipyrequests |
| Maintenance | Dormant 1,917 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 125,460 / month, #11,817 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: EducationLicense :: OSI Approved :: GNU General Public License (GPL)Operating System :: OS IndependentProgramming Language :: Python :: 3.6Topic :: Scientific/Engineering |
Evidence: PySpice-1.5-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “circuit simulation python”
- PySpicePySpice provides a Python interface to Ngspice and Xyce circuit…
- saxSAX is a JAX-based simulator and optimizer for S-parameter circuits,…
- gpluginsGplugins provides a plugin system for GDSFactory that enables device…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also gplugins · kfactory · spiceypy · FMPy · gdsfactory · sax · PyVISA-sim · pyaedt · stim · resfo-utilities