Skip to main content

Add your description here

Project description

Camunda Orchestration Cluster API – Python SDK Generator

This project generates a Python SDK for the Camunda 8 Orchestration Cluster REST API from the OpenAPI specification.

Overview

  • Fetches the OpenAPI spec via shallow clone from the public repository (fallback to local checked-out repo if offline).
  • Generates the SDK using OpenAPI Generator (prefers npx, falls back to Docker).
  • Provides an extensible hooks system for post-processing tasks.

Requirements

  • Python 3.9+
  • One of:
    • Node.js with npx available; or
    • Docker (for openapitools/openapi-generator-cli)

Quick start

cd orchestration-cluster-api-python
# Install deps and run generation (defaults to output in ./generated)
make generate

Generated SDK will be placed in generated/ by default. You can change this with --out-dir.

Using the generated SDK

The generated SDK provides a CamundaClient class that wraps the underlying API client and provides a unified interface for both synchronous and asynchronous operations.

Initialization

from camunda_orchestration_sdk import CamundaClient

# Unauthenticated (for local development)
client = CamundaClient(base_url="http://localhost:8080")

# Authenticated (for production/SaaS)
client = CamundaClient(
    base_url="https://...", 
    token="your-access-token"
)

Synchronous Usage

with CamundaClient(base_url="http://localhost:8080") as client:
    topology = client.get_topology()
    print(topology)

Asynchronous Usage

import asyncio
from camunda_orchestration_sdk import CamundaClient

async def main():
    async with CamundaClient(base_url="http://localhost:8080") as client:
        topology = await client.get_topology_async()
        print(topology)

asyncio.run(main())

Logging

The SDK uses loguru for logging. You can control the log level by setting the LOGURU_LEVEL environment variable.

# Run with INFO level (default is DEBUG)
LOGURU_LEVEL=INFO python your_script.py

# Run with WARNING level
LOGURU_LEVEL=WARNING python your_script.py

# Run with TRACE level (more verbose than DEBUG)
LOGURU_LEVEL=TRACE python your_script.py

Local fallback of the spec

If the network is not available or the remote repository cannot be reached, the generator will use the locally cloned spec at:

  • ../camunda-orchestration-cluster-api/specification/rest-api.yaml

Ensure that repository is present in the workspace if you need offline generation.

Configuration

generator-config.yaml holds OpenAPI Generator options such as package name. You may add or tweak options there.

You can also pass CLI arguments:

python3 generate.py \
  --out-dir ./generated \
  --generator python \
  --spec-ref main \
  --package-name camunda_orchestration_sdk

Run python3 generate.py --help for all options.

Hooks (post-processing)

Add Python files under hooks/ exporting a run(context) function. Hooks are executed in sorted order after generation.

context includes:

  • out_dir: path to the generated SDK directory
  • spec_path: path to the spec used for generation
  • config_path: path to the generator config file
  • generator: the generator type used (default python)

Example hook: see hooks/postprocess_example.py.

Acceptance tests (post-generation)

After generation and post-processing, acceptance tests run automatically unless --skip-tests is provided. Tests live under tests/acceptance/ and run against the generated package by injecting PYTHONPATH.

Run tests manually:

make test

Integration tests (opt-in)

Integration tests live in tests/integration and require a running server. They are skipped unless CAMUNDA_INTEGRATION=1 is set. By default, the client points to http://localhost:8080/v2; override with CAMUNDA_BASE_URL.

Run manually:

make itest

Make targets

  • make generate – run the generator (uses Python script)
  • make clean – remove the generated/ directory and cache

License

Apache-2.0

Project details


Release history Release notifications | RSS feed

This version

0.1.0

Download files

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

Source Distribution

camunda_orchestration_sdk-0.1.0.tar.gz (661.9 kB view details)

Uploaded Source

Built Distribution

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

camunda_orchestration_sdk-0.1.0-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for camunda_orchestration_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 596e2420e85aeca77a74d3f7325854b08ce81b8a70d783a096d267ed8982bc15
MD5 308e86f6bac2c3e275f49448392675c9
BLAKE2b-256 61583f471f89bbdb3f6bbea00bbd5883f2c19ba8c2983414f57caf8342d3d9a2

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on camunda/orchestration-cluster-api-python

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

File details

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

File metadata

File hashes

Hashes for camunda_orchestration_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bdaeddfe8c8c561f26da733cff9f0629c729b0f8f4c13075fac0fa9ed4bfc03
MD5 7dd4cd2c1a61c1c5a7f453af36130cf1
BLAKE2b-256 224e4c49caf7d260980a8caf4c148d7482243c98d2d4655a9ea82b6527ff6f80

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on camunda/orchestration-cluster-api-python

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