Skip to main content

Generate static types from OpenAPI specifications

Project description

sparktype

Generate static types from OpenAPI specifications.

Installation

pip install sparktype
# or
pipx install sparktype

Usage

# 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:

{
  "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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

sparktype-0.1.1-py3-none-win_amd64.whl (3.7 MB view details)

Uploaded Python 3Windows x86-64

sparktype-0.1.1-py3-none-manylinux_2_17_x86_64.whl (3.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

sparktype-0.1.1-py3-none-manylinux_2_17_aarch64.whl (3.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

sparktype-0.1.1-py3-none-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

sparktype-0.1.1-py3-none-macosx_10_9_x86_64.whl (3.6 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

Details for the file sparktype-0.1.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: sparktype-0.1.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for sparktype-0.1.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6b2782e7e93befea9d4e9bd112edff2c70f1db79097bd69322a4e2424c8a0895
MD5 4f7536b29326e51dcac0467f243cad17
BLAKE2b-256 56894c2606e49d6adc5256b2807355829c7ff74cacc58f788890289329f2cf20

See more details on using hashes here.

File details

Details for the file sparktype-0.1.1-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for sparktype-0.1.1-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 98e6e0542bef87c02c3f122b057938a2bc540d04b3b727c2f0ab77c201bd1ce3
MD5 4eb253ebd214c71f6cea54ea4adeedff
BLAKE2b-256 af1166a052fa9c7edf1e442a4bd0168d3043256f9c444f7ed31d4480c4056bd0

See more details on using hashes here.

File details

Details for the file sparktype-0.1.1-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for sparktype-0.1.1-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 ade5a76e0bddfbe7999769ab9c4460e4d38ec3d1b84688acdf53c3dbe6817ec2
MD5 0719aba8116e4dbe21323dac72771fd2
BLAKE2b-256 68c3927447a354c092e40f4eb7b2eb778ad6048296f4083dd577813089254b6c

See more details on using hashes here.

File details

Details for the file sparktype-0.1.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sparktype-0.1.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cc4fffce09d6caadab55bd99f86d64fe01c42f54802efac3f5a3544516ad3acd
MD5 ae09af44b3f90dd4ef845782f88496c7
BLAKE2b-256 62be689a4c7271880287ec661fd1304faefbe9648290c325e21bbd8183508684

See more details on using hashes here.

File details

Details for the file sparktype-0.1.1-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for sparktype-0.1.1-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 081e4a9a3eee0e259f6473fde3927dd9ea2d1472f0acd8cc084d2859b9af7558
MD5 b3592d9a959dc2eb01086862043d792c
BLAKE2b-256 f26a6f001c69c48df2a389cfae0dde2df53c68d5fa68ab1e088427c0ecfe9213

See more details on using hashes here.

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