Skip to main content

HTTP client for Turnkey API

Project description

Turnkey HTTP

HTTP client for the Turnkey API with auto-generated methods from the OpenAPI specification.

Installation

pip install turnkey-http

Or install from the repository in editable mode:

pip install -e packages/http

Usage

from turnkey_http import TurnkeyClient
from turnkey_api_key_stamper import ApiKeyStamper, ApiKeyStamperConfig

# Initialize the stamper
config = ApiKeyStamperConfig(
    api_public_key="your-api-public-key",
    api_private_key="your-api-private-key"
)
stamper = ApiKeyStamper(config)

# Create the HTTP client
client = TurnkeyClient(
    base_url="https://api.turnkey.com",
    stamper=stamper,
    organization_id="your-org-id"
)

# Make API calls with typed methods
response = client.get_whoami()
print(response)

Code Generation

This package uses code generation to create HTTP client methods from the OpenAPI specification located in schema/public_api.swagger.json.

Generate Client

To regenerate the HTTP client:

cd packages/http
python3 scripts/generate.py

The generator automatically formats code with ruff.

Development Setup

Install with dev dependencies:

pip install -e ".[dev]"

Structure

http/
├── src/
│   └── turnkey_http/
│       ├── __init__.py
│       └── generated/         # Auto-generated client (do not edit manually)
├── scripts/
│   └── generate.py           # Code generation script
├── tests/                    # Test suite
├── pyproject.toml
└── README.md

Dependencies

  • Python >= 3.8
  • requests >= 2.31.0
  • turnkey-api-key-stamper
  • turnkey-sdk-types

Development

The generated client is created from the OpenAPI specification with:

  • Typed methods for each API endpoint
  • Automatic request signing via stamper integration
  • Type hints using types from turnkey-sdk-types

Important: Never edit files in src/turnkey_http/generated/ manually. They will be overwritten on the next generation run.

Project details


Download files

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

Source Distribution

turnkey_http-0.1.0.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

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

turnkey_http-0.1.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file turnkey_http-0.1.0.tar.gz.

File metadata

  • Download URL: turnkey_http-0.1.0.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for turnkey_http-0.1.0.tar.gz
Algorithm Hash digest
SHA256 54585f652a7a1a4a5ebb951e43dc5052f587171ec411817f6addb7d4d253b174
MD5 66170550b84c4a5b7bb14a6e966e58be
BLAKE2b-256 b50b8515e1849270bf79baca4de89c445684e522fe58f6812ffc95626287650a

See more details on using hashes here.

Provenance

The following attestation bundles were made for turnkey_http-0.1.0.tar.gz:

Publisher: validate-and-publish.yml on tkhq/python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file turnkey_http-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: turnkey_http-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for turnkey_http-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcd50321f2c1c070e752df5d4a55fdab4eddf6d8ebf47987b777e8569586cd89
MD5 7fa358d3bb93cf99eb2909f4a4c1491a
BLAKE2b-256 963bcb55b00141c3a5e45b96bc16ae5d2090b23e8ebee46e699dfd90adc04e9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for turnkey_http-0.1.0-py3-none-any.whl:

Publisher: validate-and-publish.yml on tkhq/python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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