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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ x86-64

sparktype-0.1.0-py3-none-manylinux_2_17_aarch64.whl (3.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

sparktype-0.1.0-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.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: sparktype-0.1.0-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.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 08c01292c2dd6932cb0900ad7f5f8379b985f1a7fc8a267f68c53d7fb8961f18
MD5 2a536c8658e9e806c9feea8778c581e0
BLAKE2b-256 bd1d1d16214aec969b7d31c050f76949232266581dd10d3413669577620f942a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sparktype-0.1.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ad04fa2c2283cc00045ba259caab83548a82fd3150881e231f4bcc1792e2a6c0
MD5 b676dc70debada3c5e7f5947064cfbdb
BLAKE2b-256 d75e33eb6f691d6a5057cdd758714ae0db83a7e551cca39b86dd62732f4f81d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sparktype-0.1.0-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 072ad24167afe02d52e8d2f05157bdc2d3fa441a11155fe81d124af3782594df
MD5 7b7b90de8a6ed67fa37c8a31dcb84ec9
BLAKE2b-256 8b5b4628c985dd29be1dd5df12bd1a851fccb0533deea81ef06f37200f595b6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sparktype-0.1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 24617cf4845ccfbccf1ef3a53752c918b6b6394d5ef3819b4d39cbe032b735c6
MD5 92ed60b62efd2362073af0d77056497f
BLAKE2b-256 019092b85b2b23020a95a1c0d2c8ab582a398608aae9f2a5924ead52af6609c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sparktype-0.1.0-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1b7e57d762032256ebc72b427b961a9902e298aceb9112c874549767666bbfcb
MD5 be4b845c75acdc1ddb2f87f9b9d5f10a
BLAKE2b-256 53812ae0d486e85cfd256f4d2e0c310593fc2b99ddc6927e0f5604b86c1de2de

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