datasheet2spice

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

View the Project on GitHub lisiqi1983/datasheet2spice

Interface Contracts

datasheet2spice uses two stable JSON-first contracts:

The goal is to let new modules join through registration instead of changing the workbench control flow.

Shared API contract and plugin surfaces

Module Manifest

Every module should expose a small manifest:

{
  "contract": "datasheet2spice-module-v1",
  "id": "my-company.power-diode-extractor",
  "kind": "extractor",
  "label": "Power Diode Extractor",
  "version": "0.1.0",
  "description": "Extracts diode ratings and recovery parameters.",
  "component_profiles": ["diode.power"],
  "runtime_modes": ["browser-pages", "local-python"],
  "capabilities": ["extract_pdf_text", "extract_project_from_text"],
  "dependencies": []
}

Module ids should use lowercase letters, numbers, ., _, and -.

Module Kinds

Backend Operations

The shared API contract includes these operations:

Not every runtime has to implement every operation. GitHub Pages mode should provide lightweight extraction and model export. The local Python backend should provide high-fidelity extraction, evidence, fitting, and simulator adapters.

extractPdf responses return a selected project. When an extractor detects a multi-part datasheet, it should also return:

If has_default is false, frontends should require the user to choose a part before generating a single model. They may also offer all-variant bundle generation by passing projects to emitModelBundle.

Python Extension Example

from datasheet2spice.contracts import module_manifest
from datasheet2spice.plugins import extractor

@extractor("my-company.power-diode-extractor")
class PowerDiodeExtractor:
    label = "Power Diode Extractor"
    component_profiles = ("diode.power",)
    runtime_modes = ("local-python",)

    def manifest(self):
        return module_manifest(
            "my-company.power-diode-extractor",
            "extractor",
            self.label,
            component_profiles=self.component_profiles,
            runtime_modes=self.runtime_modes,
            capabilities=("extract_pdf", "extract_tables"),
        )

    def extract(self, source, **options):
        ...

Browser Extension Example

export const MY_TOOL_MODULE = {
  id: "my-company.gate-resistor-tool",
  kind: "tool-panel",
  label: "Gate Resistor Tool",
  version: "0.1.0",
  component_profiles: ["mosfet.power"],
  runtime_modes: ["browser-pages"],
  capabilities: ["render_tool_panel"],
  render(container, project) {
    // Create the tool UI here.
  }
};

Browser modules are registered with WorkbenchModuleRegistry from web/assets/module_contracts.js.

Current Built-In Modules