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.3-py3-none-win_amd64.whl (3.7 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

sparktype-0.1.3-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.3-py3-none-win_amd64.whl.

File metadata

  • Download URL: sparktype-0.1.3-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.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f486a8cdf6da7aab0aa2b94573f4937d0a4ba7ed02f258a665829f74eb8fd68d
MD5 09b4ce0d35173ea254c1119f794dde6d
BLAKE2b-256 e62c45d01888bb4b5a37410a86ac5bc5538bcce5f25be8380cb851ec4cb94596

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sparktype-0.1.3-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9e401ade5cda2142d105502495955a38db4d03bcb44e4d9eee05adb189a99b52
MD5 3d24cbb8b0bcae07874f634041ec9fd9
BLAKE2b-256 a2974debbf8ac472b12855235082f68ff01362dc63e76b4fc543b8c357a9ece4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sparktype-0.1.3-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 c22ded10442f60c5832a602553f129c0bd40b543c2ca2714b5d9654b9a56ee7e
MD5 376dfb8a385dfdb6bf0696d1e4f71308
BLAKE2b-256 130ca0e9ce8b85c45f865ac6358475fe82d47dc842b0c829c5401f6f09c038bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sparktype-0.1.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 45659815ea5e55ec1f7795190ca23e69333330df81f48b87a5ac03d871c0ed23
MD5 90fb95627186a2813c0f134382547fb7
BLAKE2b-256 6cf49990c03fa92699a61761a41eff343c0e8d7252fd4fcf3beed565cd962b17

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sparktype-0.1.3-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c9cbef43ac1f170d870a526239ba790f1d83a76aad7a5c8048a9b690cb06fe67
MD5 44468a06e3fbf8462859aaa341197b5b
BLAKE2b-256 cc51d3f31fd38664faa7fc2c8c8446f965c1f1608d603acafd314ff853361fa1

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