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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54585f652a7a1a4a5ebb951e43dc5052f587171ec411817f6addb7d4d253b174
|
|
| MD5 |
66170550b84c4a5b7bb14a6e966e58be
|
|
| BLAKE2b-256 |
b50b8515e1849270bf79baca4de89c445684e522fe58f6812ffc95626287650a
|
Provenance
The following attestation bundles were made for turnkey_http-0.1.0.tar.gz:
Publisher:
validate-and-publish.yml on tkhq/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
turnkey_http-0.1.0.tar.gz -
Subject digest:
54585f652a7a1a4a5ebb951e43dc5052f587171ec411817f6addb7d4d253b174 - Sigstore transparency entry: 1067461323
- Sigstore integration time:
-
Permalink:
tkhq/python-sdk@221a8d5fb2241e3638cb0f3037018443485eb01d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tkhq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
validate-and-publish.yml@221a8d5fb2241e3638cb0f3037018443485eb01d -
Trigger Event:
pull_request
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcd50321f2c1c070e752df5d4a55fdab4eddf6d8ebf47987b777e8569586cd89
|
|
| MD5 |
7fa358d3bb93cf99eb2909f4a4c1491a
|
|
| BLAKE2b-256 |
963bcb55b00141c3a5e45b96bc16ae5d2090b23e8ebee46e699dfd90adc04e9c
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
turnkey_http-0.1.0-py3-none-any.whl -
Subject digest:
bcd50321f2c1c070e752df5d4a55fdab4eddf6d8ebf47987b777e8569586cd89 - Sigstore transparency entry: 1067461408
- Sigstore integration time:
-
Permalink:
tkhq/python-sdk@221a8d5fb2241e3638cb0f3037018443485eb01d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tkhq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
validate-and-publish.yml@221a8d5fb2241e3638cb0f3037018443485eb01d -
Trigger Event:
pull_request
-
Statement type: