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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

sparktype-0.1.2-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.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: sparktype-0.1.2-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.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b17ea83c1ea81fec9eb5729e172e21886de62e596a2057a4c0917c345a7d5f69
MD5 499ae1f5ef24e6add3cb269d0ea91a9c
BLAKE2b-256 f314e7fac21ebab1f9261d40415ab96e1f1b18e66693e0b8ace5c5663e824b16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sparktype-0.1.2-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ba7a85d53e702e08f1cec22b1934c64971410e11a57fa07a8fe8ddc60b1abd68
MD5 1ceeb117e6061589950d434170c99f4d
BLAKE2b-256 776ba5f3e3b561878b85ba514d777a25951d705d9958ad3997c69b47f0f13d17

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sparktype-0.1.2-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 9c85d6e58b46fd2d3bf7a1b56df4b417206c909a338f2299077492ba24c22d7d
MD5 83c96217be1ae888d219e6f3510733f9
BLAKE2b-256 c10a2c38d80888b3e5bdfa4c885d7583b6e4eaf641f00ca4e16c15f8f5111731

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sparktype-0.1.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3f064e4648a47e6ce17ac464a0ad6a4c6c41b46d1d726770367dd72c13c49017
MD5 d6310a46b6a788013717d0ac04bf28a9
BLAKE2b-256 8fd36e593e05b13a293afdb34c3f3095de298d54a2db7932b8ca266bbdd5e9b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sparktype-0.1.2-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d4014b7371a2da67675c4f5a40814b8d5a02f9affc6df060a632f7c346afaaff
MD5 325857b9ee78fe3c2f900e54a7ddb980
BLAKE2b-256 253d3a5c5265e4444f8f52fcb67322af4d64fd2715e19a3dab9d36fe340d0360

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