gatana-client
Python client for the Gatana API. It is generated from the backend's OpenAPI document with openapi-python-client, and adds the loading of the credentials. Python 3.10+.
Install
pip install gatana-client
Or with uv:
uv add gatana-client
Usage
The easiest way to start is GatanaClient. It finds the configuration in parameters, environment
variables or ~/.gatana.config.
from gatana_client import GatanaClient
# Explicit
client = GatanaClient(token="gk_...", org_id="my-org")
# Or no configuration in code: reads GATANA_API_KEY and GATANA_ORG_ID,
# or else ~/.gatana.config
client = GatanaClient()
Configuration
GatanaClient uses the first source that is complete:
token, andorg_idorbase_url, passed toGatanaClient- The environment variables
GATANA_API_KEY, andGATANA_ORG_IDorGATANA_BASE_URL - The config file
~/.gatana.config
See Configuration for the environment variables and the config file, which the CLI and the JavaScript SDK also use. This package has two differences:
base_urlandGATANA_BASE_URLare the base of the API, for examplehttps://my-org.gatana.ai/api/v1. An organization ID gives that URL automatically.- It does not refresh OIDC tokens from the config file. Use an API key or a personal access token for scripts and CI.
To select the strategies yourself, give a config_loader:
from gatana_client import ConfigLoader, EnvConfigStrategy, FileConfigStrategy, GatanaClient
client = GatanaClient(
config_loader=ConfigLoader([EnvConfigStrategy(), FileConfigStrategy(org_id="other-org")])
)
Calling endpoints
Each API endpoint is a Python module with sync and async variants:
from gatana_client.api.sandboxes import list_sandboxes
with client as client:
sandboxes = list_sandboxes.sync(client=client)
Async:
async with client as client:
sandboxes = await list_sandboxes.asyncio(client=client)
Every endpoint module has four functions:
| Function | Description |
|---|---|
sync |
Blocking, returns parsed data or None |
sync_detailed |
Blocking, returns the full Response |
asyncio |
Async version of sync |
asyncio_detailed |
Async version of sync_detailed |
Development
Most of this package is generated. Run these from the repository root:
just generate-py # download the OpenAPI document and regenerate the client
just generate-py https://acme.local.gatana.ai/api/v1/openapi.json # from a local backend
The generator replaces api/, models/, types.py, errors.py and _base_client.py in
gatana_client/. These files are hand-written, and the generator keeps them: client.py,
config.py, __init__.py and py.typed.
The Python dev environment, the lint and type-check config and the tests (tests/test_config.py
for this package) are in
packages/gatana-langchain.
That package installs this one from its folder. See its README for the just py-* recipes.
Releasing
just release in the repository root releases every package with changes, this one included. To
release only this package:
just py-release gatana-client patch # tag and make a GitHub release
just py-release gatana-client patch publish # also publish to PyPI
License
Metadata
Release files for gatana-client 2.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gatana_client-2.0.4.tar.gz | 172.3 kB | Without provenance | Details for gatana_client-2.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gatana_client-2.0.4-py3-none-any.whl | Python 3 | none | any | Details for gatana_client-2.0.4-py3-none-any.whl |
Total release size: 772.3 kB
Release files / gatana_client-2.0.4.tar.gz
| Download URL | gatana_client-2.0.4.tar.gz |
|---|---|
| Size | 172.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52e4a9ecb973f7c43e167625fa5113376c7d994d227488d6a9433781da422da2
|
|
BLAKE2b-256 checksum How to use checksums |
653dbfeec2cd2e57f517ca062b191da59c6cf518861a657a7c93bbaea8bac551
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / gatana_client-2.0.4-py3-none-any.whl
| Download URL | gatana_client-2.0.4-py3-none-any.whl |
|---|---|
| Size | 600.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f06979247abba4f8e723f944edd82d46fadfd10fbe9b292425abad336eccdf4
|
|
BLAKE2b-256 checksum How to use checksums |
70705b608fb80a2181fbb925d0c302cfee9528f4e4b521cd9f96f2535b33e87c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for gatana-client 2.0.4
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.