This repository is the Python monorepo for Tilebox SDK packages. It is organized as a uv workspace with multiple publishable packages that share common development tooling and a shared dependency graph.
The workspace contains four implementation packages and a compatibility package:
tilebox-core: Publictilebox.queryvalue types andtilebox.errorsexceptions; private shared infrastructure, generated messages, conversions, transports, pagination, replay, and concurrency helpers under_tilebox. Only this distribution packages_tilebox.tilebox-grpc: Empty compatibility package depending ontilebox-core>=0.68.0, retained for one release.tilebox-datasets: Datasets SDK (tilebox.datasets) with sync + async clients, query/data model helpers, protobuf conversion, and generated datasets-related protobuf stubs.tilebox-workflows: Workflows SDK (tilebox.workflows) with job/cluster/automation clients, task model + runner, observability/tracing, and generated workflows protobuf stubs.tilebox-storage: Storage SDK (tilebox.storage) for provider-specific payload downloads (ASF, Copernicus, Umbra, Landsat, local FS), built mostly on async internals with sync wrappers.
Design choices to keep in mind:
- Namespace package layout: multiple packages contribute modules under shared top-level namespaces like
tilebox.*. - Public clients call generated Connect clients directly and convert protobuf messages to domain objects.
- Sync + async parity: datasets has native blocking and async clients with shared conversion helpers.
- External API communication uses native Connect RPC clients and protobuf-py messages.
- Use
pyqwestfor HTTP requests; it is also the HTTP library used byconnectrpc.
Use uv for all local development.
uv sync --all-packages# All packages with coverage aggregation
./tests.sh
# Single package examples
uv run --package tilebox-datasets pytest tilebox-datasets
uv run --package tilebox-workflows pytest tilebox-workflows
uv run --package tilebox-storage pytest tilebox-storage
uv run --no-sync pytest tilebox-coreuv run ruff format .
uv run ruff check --fix .
uv run ty checkuv run prek run --all-filesPre-commit hooks include YAML checks, EOF fixer, sync-with-uv, Ruff, and ty.
- Python target:
>=3.11; supported versions are 3.11 through 3.14. - Linting/formatting is Ruff-based and fairly strict (
select = ["ALL"]) with explicit ignores configured in rootpyproject.toml. - Type hints are used broadly across public APIs and internals.
- Prefer dataclasses and explicit domain objects for request/response translation.
- Keep transport and error translation in
_tilebox; request construction and response conversion belong in clients. - Workflows uses a lightweight structured facade over stdlib logging, with separate internal and task channels;
- Tests use
pytest, with async coverage (pytest-asyncio) and property-based testing (hypothesis) in multiple packages.
- Keep
tilebox.workflowstask-authoring imports light. Release runners create fresh virtual environments, so avoid importing heavy optional/runtime dependencies (pandas,numpy,xarray, cloud SDKs,ipywidgets, OpenTelemetry SDK/exporters, cache backends) from package__init__modules or coreRunner/Taskimport paths. - Prefer lazy imports inside the methods that actually need those dependencies. Module-level
__getattr__aliases are acceptable for public package aliases and are supported by Python 3.7+.
Generated files live under paths such as:
tilebox-datasets/tilebox/datasets/v1/*_pb.pytilebox-datasets/tilebox/datasets/stac/v1/*_pb.pytilebox-core/_tilebox/proto/tilebox/v1/*_pb.pytilebox-workflows/tilebox/workflows/v1/*_pb.pytilebox-workflows/tilebox/workflows/_otel/opentelemetry/proto/**
Regenerate protobuf code with:
./tools/generate-protobuf.shThis uses buf.gen.yaml with pinned local plugins and import mappings.
The script strips upstream trailing whitespace with Ruff and places the generated modules in their owning packages.
- Many protobuf contracts are sourced from the separate
apirepository/module (buf.build/tilebox/api, with optional local../apiinput in buf configs). - Do not hand-edit generated
*_pb.pyor*_connect.pyfiles. - If a requested change requires modifying protobuf schema/contracts, that change must be made in the
apirepo first. - Whenever schema/proto edits are needed, ask the developer to point you to the
apirepo so those changes can be implemented there and then regenerated here.