Skip to main content

Cecil SDK

Python SDK for the Cecil API. Manage AOIs, subscriptions, users, and webhooks; load subscription outputs directly into xarray (Zarr, TIFF) and geopandas (parquet).

Full API reference and product docs: docs.cecil.earth.

Setup

Requirements

  • Python >=3.11
  • A Cecil API key (get one via the Cecil web app or Client.recover_api_key)

Install

pip install cecil

Authenticate

The SDK reads your API key from the CECIL_API_KEY environment variable:

export CECIL_API_KEY=<your-cecil-api-key>

Development

First request

import os
from cecil import Client

client = Client()

# List subscriptions in your organisation
subscriptions = client.list_subscriptions()
for s in subscriptions:
    print(s.id, s.dataset_id)

Create an AOI and subscribe it to a dataset

aoi = client.create_aoi(
    geometry={
        "type": "Polygon",
        "coordinates": [[[-0.15, 51.50], [-0.10, 51.50], [-0.10, 51.55], [-0.15, 51.55], [-0.15, 51.50]]],
    },
    external_ref="my-aoi-1",
)

subscription = client.create_subscription(
    aoi_id=aoi.id,
    dataset_id="<dataset-uuid>",
    external_ref="my-sub-1",
)

Load subscription output into xarray

ds = client.load_xarray(subscription_id=subscription.id)

Under the hood this fetches the subscription's file listing and reads Zarr or TIFF as appropriate.

Load a self-hosted dataset as a GeoDataFrame

gdf = client.load_dataframe(subscription_id=subscription.id)

Point the client at a non-prod environment

client = Client(env="dev")     # https://dev.cecil.earth
client = Client(env="staging") # https://staging.cecil.earth
# omit env for prod → https://api.cecil.earth

Local development

If you're editing the SDK itself, see CONTRIBUTING.md for the editable-install and PyPI test-upload flow. Short version:

Clone

git clone git@github.com:cecilearth/sdk.git
cd sdk

Install packaging tools + editable mode

pip install hatch twine black
pip install -e .

Test

make test

Runs hatch test -v (uses the responses library to stub HTTP; no live API calls).

Lint / format

black src tests

Deploy

The SDK is published to PyPI, not deployed to AWS.

Publish a release candidate to Test PyPI

make publish.test

Publish to production PyPI

make publish.prod

Both commands run clean, build (via hatch build), then twine upload. Put your Test PyPI and PyPI tokens in ~/.pypirc first (see CONTRIBUTING.md). Bump src/cecil/version.py and add a CHANGELOG.md entry before publishing.

Architecture

Single-package Python project built with hatch.

  • src/cecil/
    • __init__.py — public surface: Client, Error, __version__.
    • client.py — the main Client class. Constructor picks a base URL from the env arg (defaults to https://api.cecil.earth). Every method delegates through _request(), which pulls CECIL_API_KEY from the environment on demand and attaches HTTP Basic Auth (username = key, no password).
    • dataframe.py — load_dataframe() / load_self_hosted_dataframe() — retrieves parquet URLs from the API and reads them via pyarrow + geopandas.
    • xarray.py — load_xarray_from_tiff() / load_xarray_from_zarr() — reads raster subscription outputs via rioxarray / zarr (with s3fs/dask for large Zarr).
    • models/ — Pydantic models: AOI, Dataset, Settings, Subscription (+ SubscriptionTIFF, SubscriptionZarr, SubscriptionParquet, SubscriptionSelfHostedParquet, SubscriptionFormat, SubscriptionStorage), User, Webhook.
    • errors.py — Error, HTTPError, SDKError.
    • version.py — __version__ (hatch reads this dynamically).
  • tests/ — unit tests using responses to stub HTTP.
  • pyproject.toml — declares the cecil package, deps (boto3, dask, geopandas, pyarrow, pydantic, requests, rioxarray, s3fs, xarray, zarr), Python >=3.11.
  • Makefile — build, clean, test, publish.test, publish.prod.
  • CHANGELOG.md — release notes.
  • CONTRIBUTING.md — dev install + PyPI setup.
  • LICENSE.txt — MIT.

How it fits with sibling repos

  • Every method on Client maps to a /v0/* route served by cecilearth/api (see handler/api/).
  • Subscription output files (Zarr, TIFF, geoparquet) are read straight from the subscription-tiff and dataset S3 buckets provisioned in api's Terraform — the client fetches presigned URLs via the API, then reads the bytes directly.
  • cecilearth/examples contains Jupyter notebooks that use this SDK end-to-end.

Metadata

Release files for cecil 0.1.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cecil 0.1.14
File Size Uploaded Provenance Actions
cecil-0.1.14.tar.gz 14.0 kB Without provenance Details for cecil-0.1.14.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cecil 0.1.14
File Interpreter ABI Platform Actions
cecil-0.1.14-py3-none-any.whl Python 3 none any Details for cecil-0.1.14-py3-none-any.whl

Total release size: 29.5 kB

Release files / cecil-0.1.14.tar.gz

Download URL cecil-0.1.14.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
dffe9764f474759fd040db82d5bdc6863cda66c850f72ef3d0551c83bea00d4e
BLAKE2b-256 checksum
How to use checksums
568b49c86060d030454a9ce6154a046dae4ce8e2c8f06d40d62cbe8b7dcc08e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Release files / cecil-0.1.14-py3-none-any.whl

Download URL cecil-0.1.14-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4448150a68169b312ab0278d2395420e8741420e762a2905e0bad4dbf062b31e
BLAKE2b-256 checksum
How to use checksums
fbb6af10e9f6f5027241784a286864ad342b9699ff05a2a2078739d798a7d7a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Security for cecil 0.1.14

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.

Release history Release notifications | RSS feed

This release

0.1.14 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page