semvec/pypi-packages huggingface dataset:
sparktype 0.1.3
Generate static types from OpenAPI specifications
License: MIT
Requires Python: >=3.8
Keywords: openapi, typescript, codegen, types, schema, zod, python

# sparktype

Generate static types from OpenAPI specifications.

## Installation

```bash
pip install sparktype
# or
pipx install sparktype
```

## Usage

```bash
# Generate types using typegen.jsonc in current directory
sparktype generate

# Specify config file
sparktype generate --config ./path/to/typegen.jsonc

# Initialize a new config file
sparktype init

# Validate config file
sparktype validate
```

## Configuration

Create a `typegen.jsonc` file:

```jsonc
{
  "specs": {
    "api": {
      "path": "./openapi.yaml"
    }
  },
  "outputs": [
    {
      "path": "./types.py",
      "format": "python",
      "spec": "api"
    }
  ]
}
```

## Supported Output Formats

- `typescript` - TypeScript interfaces
- `zod` - Zod schemas with inferred types
- `zod-typescript` - Both Zod schemas and TypeScript interfaces
- `python` - Python TypedDict classes
- `go` - Go structs with JSON tags

## Documentation

For full documentation, visit: https://github.com/hntrl/sparktype