Skip to main content

Python client for the APEx Dispatch API

Project description

APEx Dispatch API Client

Python client for the APEx Dispatch API.

The package is generated from the APEx Dispatch OpenAPI schema and provides typed request and response models, synchronous and asynchronous endpoint helpers, and httpx-based client configuration.

Installation

Install the package from this repository:

pip install .

For local development, use the Hatch environments defined in pyproject.toml:

hatch run test:test
hatch run docs:build

Quick Start

from apex_dispatch_api_client.client import AuthenticatedClient
from apex_dispatch_api_client.api.unit_jobs import create_unit_job_unit_jobs_post
from apex_dispatch_api_client.models.base_job_request import BaseJobRequest
from apex_dispatch_api_client.models.base_job_request_parameters import (
    BaseJobRequestParameters,
)
from apex_dispatch_api_client.models.output_format_enum import OutputFormatEnum
from apex_dispatch_api_client.models.process_type_enum import ProcessTypeEnum
from apex_dispatch_api_client.models.service_details import ServiceDetails

client = AuthenticatedClient(
    base_url="https://dispatch-api.dev.apex.esa.int",
    token="YOUR_ACCESS_TOKEN",
)

parameters = BaseJobRequestParameters()
parameters["bbox"] = [12.0, 41.0, 13.0, 42.0]
parameters["resolution"] = 10

request = BaseJobRequest(
    title="Vegetation index",
    label=ProcessTypeEnum.OGC_API_PROCESS,
    service=ServiceDetails(
        endpoint="https://processes.example.test",
        application="/processes/vegetation-index",
        namespace="apex",
    ),
    parameters=parameters,
    format_=OutputFormatEnum.GEOJSON,
)

job = create_unit_job_unit_jobs_post.sync(client=client, body=request)
print(job)

Use sync_detailed when you need the HTTP status code, headers, or raw response content:

response = create_unit_job_unit_jobs_post.sync_detailed(
    client=client,
    body=request,
)

print(response.status_code)
print(response.parsed)

Every generated operation module follows the same pattern:

  • sync(...) returns the parsed response body.
  • sync_detailed(...) returns apex_dispatch_api_client.types.Response.
  • asyncio(...) is the asynchronous parsed-body helper.
  • asyncio_detailed(...) is the asynchronous detailed helper.

Client Types

Use Client for public endpoints such as /health.

Use AuthenticatedClient for secured endpoints. By default it sends Authorization: Bearer <token>. You can customize the header for other API gateway schemes:

from apex_dispatch_api_client.client import AuthenticatedClient

client = AuthenticatedClient(
    base_url="https://dispatch-api.dev.apex.esa.int",
    token="YOUR_API_KEY",
    prefix="",
    auth_header_name="X-Api-Key",
)

Documentation

The MkDocs documentation is organized with the Diataxis framework:

  • Tutorials for learning the client.
  • How-to guides for common tasks.
  • Reference pages for clients, operations, and models.
  • Explanation pages for generated-client behavior and model serialization.

Build the documentation locally with:

hatch run docs:build

Serve it locally with:

hatch run docs:serve

Regenerating the Client

The default Taskfile task downloads the APEx Dispatch OpenAPI schema and regenerates the client:

task

The schema is stored in schemas/openapi.json, and generated Python code is written to src/apex_dispatch_api_client.

License

This project is licensed under the Apache License 2.0. See LICENSE.

Project details


Download files

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

Source Distribution

apex_dispatch_api_client-0.7.2.tar.gz (115.3 kB view details)

Uploaded Source

Built Distribution

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

apex_dispatch_api_client-0.7.2-py3-none-any.whl (72.9 kB view details)

Uploaded Python 3

File details

Details for the file apex_dispatch_api_client-0.7.2.tar.gz.

File metadata

  • Download URL: apex_dispatch_api_client-0.7.2.tar.gz
  • Upload date:
  • Size: 115.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for apex_dispatch_api_client-0.7.2.tar.gz
Algorithm Hash digest
SHA256 5ae0e4312abc521a8f90787a42906a772d59d04a74c95a0c260277b5d90aabec
MD5 d3a4f4d6761365e5be848b324829262b
BLAKE2b-256 90b6226e36daf9bbf6e1197064c3b965137c9a46f2ff856f74cddb6b8ea9b500

See more details on using hashes here.

Provenance

The following attestation bundles were made for apex_dispatch_api_client-0.7.2.tar.gz:

Publisher: package.yaml on ESA-APEx/apex_dispatch_api_client

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

File details

Details for the file apex_dispatch_api_client-0.7.2-py3-none-any.whl.

File metadata

File hashes

Hashes for apex_dispatch_api_client-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 24438bb748022396b3637aa22be39694e9bde3d65701c577d2127f8425b5087b
MD5 563aaa370ba79a24553f8b4ddde24305
BLAKE2b-256 0546057029739432a476d68adff888a984d8ceb043ff191f574054f0f5eee621

See more details on using hashes here.

Provenance

The following attestation bundles were made for apex_dispatch_api_client-0.7.2-py3-none-any.whl:

Publisher: package.yaml on ESA-APEx/apex_dispatch_api_client

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