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(...)returnsapex_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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ae0e4312abc521a8f90787a42906a772d59d04a74c95a0c260277b5d90aabec
|
|
| MD5 |
d3a4f4d6761365e5be848b324829262b
|
|
| BLAKE2b-256 |
90b6226e36daf9bbf6e1197064c3b965137c9a46f2ff856f74cddb6b8ea9b500
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apex_dispatch_api_client-0.7.2.tar.gz -
Subject digest:
5ae0e4312abc521a8f90787a42906a772d59d04a74c95a0c260277b5d90aabec - Sigstore transparency entry: 1730970065
- Sigstore integration time:
-
Permalink:
ESA-APEx/apex_dispatch_api_client@fec283a2d35f8e2319422ab4e726a95867631adc -
Branch / Tag:
refs/tags/v0.7.2 - Owner: https://github.com/ESA-APEx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yaml@fec283a2d35f8e2319422ab4e726a95867631adc -
Trigger Event:
push
-
Statement type:
File details
Details for the file apex_dispatch_api_client-0.7.2-py3-none-any.whl.
File metadata
- Download URL: apex_dispatch_api_client-0.7.2-py3-none-any.whl
- Upload date:
- Size: 72.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24438bb748022396b3637aa22be39694e9bde3d65701c577d2127f8425b5087b
|
|
| MD5 |
563aaa370ba79a24553f8b4ddde24305
|
|
| BLAKE2b-256 |
0546057029739432a476d68adff888a984d8ceb043ff191f574054f0f5eee621
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apex_dispatch_api_client-0.7.2-py3-none-any.whl -
Subject digest:
24438bb748022396b3637aa22be39694e9bde3d65701c577d2127f8425b5087b - Sigstore transparency entry: 1730970093
- Sigstore integration time:
-
Permalink:
ESA-APEx/apex_dispatch_api_client@fec283a2d35f8e2319422ab4e726a95867631adc -
Branch / Tag:
refs/tags/v0.7.2 - Owner: https://github.com/ESA-APEx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yaml@fec283a2d35f8e2319422ab4e726a95867631adc -
Trigger Event:
push
-
Statement type: