datasheet2spice

Traceable datasheet-to-SPICE model generation for power MOSFETs and diodes, with validation benchmarks.

View the Project on GitHub lisiqi1983/datasheet2spice

Plugin Interfaces

The plugin registry supports component profiles, emitters, extractors, fitters, tool panels, and validators.

Each registered plugin is also represented by a datasheet2spice-module-v1 manifest. See Interface Contracts for the manifest shape and backend operation contract.

Component Profiles

Component profiles define what a device family expects from extraction, fitting, and model generation.

The first built-in profile is:

Future profiles should add their own expected fields, recommended model families, validators, and review tools without changing the core schema.

Emitters

from datasheet2spice.plugins import emitter

@emitter("my-model")
class MyEmitter:
    def emit(self, project, dialect="common"):
        return {"model.lib": "* spice text\n"}

Built-in emitters:

Extractors

Built-in extractors:

Validators

Built-in validators:

Optional extractors can live under datasheet2spice.extractors or in external packages.

Fitters and Tool Panels

Fitters are intended for parameter extraction from curves, measured waveforms, or reviewed project data. Tool panels are intended for frontend extensions such as gate-resistor calculators, thermal RC fitters, double-pulse setup helpers, and curve review utilities.

These interfaces are registered today so downstream packages can target them, even though the built-in v1 package only ships MOSFET starter fitting helpers.

Third-Party Package Loading

External packages can expose a plugin entry point in pyproject.toml:

[project.entry-points."datasheet2spice.plugins"]
my_vendor_models = "my_vendor_models"

The target can be a module imported for decorator side effects, or a callable that accepts the global registry:

def register(registry):
    registry.extractors["my-extractor"] = MyExtractor()

The CLI loads these entry points before emit and plugins.

Optional PDF Extraction

datasheet2spice.extractors.pymupdf_vector demonstrates a PyMuPDF-based vector extractor. It imports PyMuPDF only inside the function so users who do not want AGPL/commercial PyMuPDF do not need to install it.

CSV Curve Import

datasheet2spice.extractors.csv_curves.read_capacitance_csv supports CSV exports from WebPlotDigitizer, StarryDigitizer, or spreadsheets, with columns:

vds_v,ciss_pf,coss_pf,crss_pf