Skip to main content

Spice toolbox

Project description

cicspi

cicspi is a small SPICE parsing toolbox that reads .subckt definitions into a Python object hierarchy and exposes a simple CLI.

Install

python3 -m pip install cicspi

CLI

Print the node list for a subckt in a SPICE file:

cicspi nodes path/to/netlist.spi my_subckt

Python usage

import cicspi

parser = cicspi.SpiceParser()
parser.parseFile("path/to/netlist.spi")

# SpiceParser is a dict: subckt name → Subckt object
ckt = parser["my_subckt"]

print(ckt.nodes)        # list of port node names
print(ckt.instances)    # list of SubcktInstance objects

# Collapse bus signals (e.g. A[0], A[1] → A[0:1])
print(ckt.nodesWithBus())

# Iterate instances
for inst in ckt.instances:
    print(inst.name, inst.subcktName, inst.nodes)

# Emit SPICE text
print(ckt.tospice())

# JSON round-trip
import json
print(json.dumps(ckt.toJson(), indent=2))

Object model

Class Description
SpiceParser dict subclass; maps subckt name → Subckt. Also tracks all instance types in .allinst.
Subckt One .subckt/.ends block. Has .name, .nodes, .instances (list of SubcktInstance), .devices.
SubcktInstance One X-line. Has .name, .subcktName, .nodes, .groupName.
Device Primitive device (future use).
SpiceObject Base class for all objects; provides .properties dict, JSON serialisation, and .nodesWithBus().

Release flow

PyPI publishing is handled by GitHub Actions in .github/workflows/release.yml. Push a tag to trigger a release:

git tag 0.x.y && git push origin 0.x.y

The workflow builds the package, publishes to PyPI via OIDC trusted publishing, and creates a GitHub release with the distribution artifacts attached.

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

cicspi-0.1.4.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

cicspi-0.1.4-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file cicspi-0.1.4.tar.gz.

File metadata

  • Download URL: cicspi-0.1.4.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cicspi-0.1.4.tar.gz
Algorithm Hash digest
SHA256 45fbbc8ffdf27a241332e74f0683cc9ca0d930f15f2be70f5caf6433e39a24dd
MD5 c919e26e1fa1f913335ffd25230e8686
BLAKE2b-256 5d9d07e02f4c28a14d518215d896c9461aa4f01b6d7c3776d425eb24f6074e1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cicspi-0.1.4.tar.gz:

Publisher: release.yml on wulffern/cicspi

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

File details

Details for the file cicspi-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: cicspi-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cicspi-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 405e81285eea5f14df469fa6448199467b0f725c94be90ddbdb98ae70643a073
MD5 9f984abeb9db1f95739562c82094380d
BLAKE2b-256 a4b36d33e3e78d52b8ba7e580c96946a0bfda029897846adf5e56c12b6d7288d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cicspi-0.1.4-py3-none-any.whl:

Publisher: release.yml on wulffern/cicspi

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