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.
Release files for turnkey-http 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| turnkey_http-0.1.0.tar.gz | 19.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| turnkey_http-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.1 kB
Release files / turnkey_http-0.1.0.tar.gz
| Download URL | turnkey_http-0.1.0.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54585f652a7a1a4a5ebb951e43dc5052f587171ec411817f6addb7d4d253b174
|
|
BLAKE2b-256 checksum How to use checksums |
b50b8515e1849270bf79baca4de89c445684e522fe58f6812ffc95626287650a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 9, 2026.
Transparency logRelease files / turnkey_http-0.1.0-py3-none-any.whl
| Download URL | turnkey_http-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bcd50321f2c1c070e752df5d4a55fdab4eddf6d8ebf47987b777e8569586cd89
|
|
BLAKE2b-256 checksum How to use checksums |
963bcb55b00141c3a5e45b96bc16ae5d2090b23e8ebee46e699dfd90adc04e9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 9, 2026.
Transparency log