Python modules for running Ngspice
Project description
Python-for-Spice (py4spice)
Lightweight Python package interface to Ngspice
Motivation
Ngspice is an open source electrical circuit simulator. It typically executes in batch mode using an archaic script interface. The Python-for-Spice package facilitates Ngspice execution using Python scripts. You can launch multiple analyses and convert the results to NumPy arrays, enabling downstream computation or plotting with Matplotlib.
A modest knowledge of Ngspice and Python is required.
Installation
Install Ngspice
Ngspice must be installed. For most Linux distributions, ngspice can be installed with a package manager. As an example, for Debian use the following commands:
sudo apt update
sudo apt install ngspice
ngspice -v
Install py4spice
py4spice is installed in the customary way for a PyPI package.
sudo apt update
sudo apt install py4spice
Package Modules
| Module | Description |
|---|---|
analyses |
Prepares analysis command that will go into control file and be executed during simulation |
control |
Generate control file to for a simulation |
kicad_netlist |
Create and execute a Kicad netlist export from a schematic |
netlist |
Create, modify, and combine netlists to prepare for an Ngspice simulation |
plot |
Matplotlib plot of numpy results from simulation |
print_section |
Section off text so it is easier to read in terminal |
sim_results |
Create objects for results extracted from simulation text files. Depending on the analysis type, the data are stored in different ways: either a plot or a table (dictionary) |
simulate |
Setup or run an Ngspice simulation |
step_info |
Perform variable measurements from step analyses. (i.e. rise-time, frequency, ...) |
vectors |
Vector set of signals for which to gather data, plot, ... |
waveforms |
Waveforms with a single x value and one or more y values in a 2D numpy array. Header defines the column names |
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
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 py4spice-0.1.0.tar.gz.
File metadata
- Download URL: py4spice-0.1.0.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76bac0459c9fee5a5dacfd960f12c6f33d656cab54afd562ba2f0ce2040bb992
|
|
| MD5 |
2cb6079b789a3b5ce4454399a91c8995
|
|
| BLAKE2b-256 |
14b1a720aa6ea48cdee65ca0957797db13c171056d95532cad9e3983c4903f88
|
Provenance
The following attestation bundles were made for py4spice-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on astorguy/py4spice
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py4spice-0.1.0.tar.gz -
Subject digest:
76bac0459c9fee5a5dacfd960f12c6f33d656cab54afd562ba2f0ce2040bb992 - Sigstore transparency entry: 731853562
- Sigstore integration time:
-
Permalink:
astorguy/py4spice@f33115a437873a283531289b78acff5f231de5d1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/astorguy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@f33115a437873a283531289b78acff5f231de5d1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file py4spice-0.1.0-py3-none-any.whl.
File metadata
- Download URL: py4spice-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc88a6eb456b27b3bb7758b6176b8d3fd1fb92fd0b606dcc420eb8c0d72f50d4
|
|
| MD5 |
918e0b3292062f485ecdd1ed55e08f35
|
|
| BLAKE2b-256 |
2f9f46ca16240006dd0fb790f493b7b0711b1ec73de0277f543ca2b3a7b2127d
|
Provenance
The following attestation bundles were made for py4spice-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on astorguy/py4spice
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py4spice-0.1.0-py3-none-any.whl -
Subject digest:
cc88a6eb456b27b3bb7758b6176b8d3fd1fb92fd0b606dcc420eb8c0d72f50d4 - Sigstore transparency entry: 731853566
- Sigstore integration time:
-
Permalink:
astorguy/py4spice@f33115a437873a283531289b78acff5f231de5d1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/astorguy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@f33115a437873a283531289b78acff5f231de5d1 -
Trigger Event:
release
-
Statement type: