Skip to main content

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

py4spice-0.1.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py4spice-0.1.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

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

Hashes for py4spice-0.1.0.tar.gz
Algorithm Hash digest
SHA256 76bac0459c9fee5a5dacfd960f12c6f33d656cab54afd562ba2f0ce2040bb992
MD5 2cb6079b789a3b5ce4454399a91c8995
BLAKE2b-256 14b1a720aa6ea48cdee65ca0957797db13c171056d95532cad9e3983c4903f88

See more details on using hashes here.

Provenance

The following attestation bundles were made for py4spice-0.1.0.tar.gz:

Publisher: publish-to-pypi.yml on astorguy/py4spice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for py4spice-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc88a6eb456b27b3bb7758b6176b8d3fd1fb92fd0b606dcc420eb8c0d72f50d4
MD5 918e0b3292062f485ecdd1ed55e08f35
BLAKE2b-256 2f9f46ca16240006dd0fb790f493b7b0711b1ec73de0277f543ca2b3a7b2127d

See more details on using hashes here.

Provenance

The following attestation bundles were made for py4spice-0.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on astorguy/py4spice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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