Metadata-Version: 2.4
Name: spice3
Version: 0.1.0
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Education
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
Classifier: Typing :: Typed
Requires-Dist: polars>=1.0
Requires-Dist: numpy>=1.23
Requires-Dist: pandas>=2.0 ; extra == 'pandas'
Requires-Dist: pyarrow>=14 ; extra == 'pyarrow'
Requires-Dist: pytest>=8 ; extra == 'test'
Requires-Dist: pandas>=2.0 ; extra == 'test'
Provides-Extra: pandas
Provides-Extra: pyarrow
Provides-Extra: test
Summary: SPICE3f5-faithful circuit simulation (the Dune engine) for Python
Keywords: spice,circuit-simulation,spice3f5,ngspice,eda,electronics,transient-analysis
Author-email: André Leite <leite@de.ufpe.br>
Maintainer-email: André Leite <leite@de.ufpe.br>
License-Expression: BSD-3-Clause
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Issues, https://github.com/milkway/dune/issues
Project-URL: Repository, https://github.com/milkway/dune

# spice3

`pip install spice3` → `import spice`.

Circuit simulation for Python, powered by **Dune** — a Rust engine
derived from Berkeley **SPICE3f5** and validated circuit-by-circuit
against **ngspice** as numerical oracle.

> **Status: pre-alpha.** This release reserves the package name while
> the engine's first public version is being finished. The API below
> works today but may still change.

```python
from pathlib import Path
import spice

result = spice.simulate(Path("rc.cir"))
plot = result.plot("Transient Analysis")
df = plot.df()          # polars DataFrame, scale column first
v2 = plot.column("v(2)")  # zero-copy, read-only numpy array
```

- Every SPICE3f5 analysis: `.op`, `.dc`, `.tran`, `.ac`, `.pz`,
  `.noise`, `.disto`, `.tf`, `.sens` — plus the periodic steady state
  of driven circuits (`.pss`, shooting–Newton; `spice.pss()`).
- All SPICE3f5 devices, including BJT (Gummel–Poon), MOS levels
  1/2/3/6, BSIM1/BSIM2, JFET, MESFET, switches and both
  transmission lines.
- Results as [polars](https://pola.rs) DataFrames (pandas optional)
  and zero-copy NumPy arrays; complete type annotations (`py.typed`).
- Schematics as decks: `spice.pic.extract()` reads the netlist of an
  [rpic](https://github.com/milkway/rpic-lang) figure drawn with the
  dune prelude, `spice.simulate()` runs it and `spice.pic.render()`
  draws it as SVG (with typeset `$...$` labels).
- Faithful netlist semantics: decks that run under `spice3 -b` or
  `ngspice -b` run here, with structured, span-carrying errors.

The engine, corpus and oracle harness live in the
[Dune repository](https://github.com/milkway/dune). BSD-3-Clause,
© André Leite and The Regents of the University of California.

