This release is a pre-release and may not be stable for production use.
kestrapy — Kestra Python SDK
Official Python SDK for the Kestra API. Use it to manage flows, executions and other resources programmatically from a Python application.
All API operations, except for Instance-owner-only endpoints, require a tenant identifier in the HTTP path. Endpoints designated as Instance-owner-only are not tenant-scoped.
- Package:
kestrapy - Source: https://github.com/kestra-io/client-sdk (
python/python-sdk) - Requires Python 3.9+
This SDK is hand-written. Do not regenerate it — edit the sources under
python/python-sdkdirectly.
Installation
pip install kestrapy
Getting started
Create a Configuration, configure the host and authentication, then
instantiate the single KestraClient that gathers every API:
from kestrapy import Configuration, KestraClient
configuration = Configuration()
configuration.host = "http://localhost:8080"
configuration.username = "root@root.com"
configuration.password = "Root!1234"
kestra_client = KestraClient(configuration)
tenant = "main"
# List the first page of flows in the tenant.
flows = kestra_client.flows.search_flows(tenant, page=1, size=10)
print(f"Found {len(flows.results)} flows")
# Create a new flow from its YAML source.
flow = """
id: hello_from_sdk
namespace: company.team
tasks:
- id: hello
type: io.kestra.plugin.core.log.Log
message: Hello from the Kestra Python SDK!
"""
created = kestra_client.flows.create_flow(tenant, flow)
print(f"Created flow {created.namespace}.{created.id} (revision {created.revision})")
Authentication
The client supports HTTP basic auth and bearer tokens. Prefer reading credentials from the environment rather than hard-coding them:
import os
from kestrapy import Configuration, KestraClient
# HTTP basic authentication
configuration = Configuration(
host="http://localhost:8080",
username=os.environ["KESTRA_USERNAME"],
password=os.environ["KESTRA_PASSWORD"],
)
kestra_client = KestraClient(configuration)
# ...or a bearer token (service-account API token / JWT)
kestra_client = KestraClient(
host="http://localhost:8080",
token=os.environ["KESTRA_TOKEN"],
)
Pass bearer tokens with the token= keyword: KestraClient does not read
Configuration.access_token.
Errors
API calls raise kestrapy.rest.ApiException on non-2xx responses:
from kestrapy.rest import ApiException
try:
kestra_client.flows.flow("company.team", "does_not_exist", tenant)
except ApiException as e:
print(f"Kestra API returned {e.status}: {e.reason}")
Documentation for API Endpoints
Per-method reference (signatures, parameters, examples) for the most-used APIs.
Every KestraClient accessor is documented by its docstrings.
| Accessor | Reference |
|---|---|
kestra_client.executions |
ExecutionsApi |
kestra_client.flows |
FlowsApi |
kestra_client.groups |
GroupsApi |
kestra_client.kv |
KVApi |
kestra_client.logs |
LogsApi |
kestra_client.namespaces |
NamespacesApi |
kestra_client.roles |
RolesApi |
kestra_client.service_account |
ServiceAccountApi |
kestra_client.triggers |
TriggersApi |
kestra_client.users |
UsersApi |
Documentation for Models
Each model has a page under docs/ named after the class, for
example FlowWithSource.
Documentation for Authorization
basicAuth
HTTP basic authentication: set username and password on the
Configuration (or pass them to KestraClient).
bearerAuth
Bearer token (service-account API token / JWT): KestraClient(host=..., token=...).
Development
Run the test suite with pytest. See
AGENTS.md in the
repository root for contribution notes.
Metadata
Release files for kestrapy 2.1.0.dev502
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 |
|---|---|---|---|---|
| kestrapy-2.1.0.dev502.tar.gz | 329.4 kB | Without provenance | Details for kestrapy-2.1.0.dev502.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kestrapy-2.1.0.dev502-py3-none-any.whl | Python 3 | none | any | Details for kestrapy-2.1.0.dev502-py3-none-any.whl |
Total release size: 1.5 MB
Release files / kestrapy-2.1.0.dev502.tar.gz
| Download URL | kestrapy-2.1.0.dev502.tar.gz |
|---|---|
| Size | 329.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13dc494eae5eb8cfcdad906b64e52cbb69cb2b1e0be52bf3ef0ca2111311ad00
|
|
BLAKE2b-256 checksum How to use checksums |
51338c880762637071131ad19c00eafc6ab1ff03996e694350e5c927d45460c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / kestrapy-2.1.0.dev502-py3-none-any.whl
| Download URL | kestrapy-2.1.0.dev502-py3-none-any.whl |
|---|---|
| Size | 1.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64b62f870f1dfd4cb91353ad1ea5b66ce6cd04e95eb1993f63fa5c7af24a5473
|
|
BLAKE2b-256 checksum How to use checksums |
f77fc3e806f3d2e83483c81f8ae7ca03989ff6fc1b9924935c773ac79ad67143
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for kestrapy 2.1.0.dev502
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.