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 mainClientclass. Constructor picks a base URL from theenvarg (defaults tohttps://api.cecil.earth). Every method delegates through_request(), which pullsCECIL_API_KEYfrom 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 viapyarrow+geopandas.xarray.py—load_xarray_from_tiff()/load_xarray_from_zarr()— reads raster subscription outputs viarioxarray/zarr(withs3fs/daskfor 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__(hatchreads this dynamically).
tests/— unit tests usingresponsesto stub HTTP.pyproject.toml— declares thececilpackage, 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
Clientmaps to a/v0/*route served bycecilearth/api(seehandler/api/). - Subscription output files (Zarr, TIFF, geoparquet) are read straight from the
subscription-tiffand dataset S3 buckets provisioned inapi's Terraform — the client fetches presigned URLs via the API, then reads the bytes directly. cecilearth/examplescontains Jupyter notebooks that use this SDK end-to-end.
Cross-links
- Docs: docs.cecil.earth
- Onboarding: https://github.com/cecilearth/onboarding/blob/main/docs/platform-architecture.md
- Sibling repos:
- cecilearth/api — the backend this SDK targets
- cecilearth/examples — end-to-end notebooks using this SDK
- cecilearth/cecil-assistant — CLI assistant that also uses
CECIL_API_KEY
Metadata
Release files for cecil 0.1.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cecil-0.1.15.tar.gz | 14.2 kB | Without provenance | Details for cecil-0.1.15.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cecil-0.1.15-py3-none-any.whl | Python 3 | none | any | Details for cecil-0.1.15-py3-none-any.whl |
Total release size: 29.6 kB
Release files / cecil-0.1.15.tar.gz
| Download URL | cecil-0.1.15.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6cfefcae2628d49800760e47548f2e8dd020b6f133aadb5334e5bc2e736a8fa9
|
|
BLAKE2b-256 checksum How to use checksums |
eb42b3778f2d529e48569f909fd5ae89e58c4551c51b07799227e4a1fd5d8eed
|
| 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.15-py3-none-any.whl
| Download URL | cecil-0.1.15-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b7bc05bb87fad1bea9550f69dbb2a231a1525999fe60a6e7aad937bd3653920
|
|
BLAKE2b-256 checksum How to use checksums |
bf396e369a927e0e899c98b7ababa5605f53f19e6f8406917ace8d04bfb224d2
|
| 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.15
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.