The Cecil SDK is a Python library that allows you to use our data platform. The SDK integrates with our internal API using standard HTTP methods, authentication, and response codes. Our data resources use RFC 3339 timestamps and universally unique identifiers (UUID v4).

Installation

Install the SDK in your project virtual environment. Python ≥ 3.10 is required.

pip install cecil

Authentication

Configure the SDK by setting the CECIL_API_KEY environment variable. Make sure to store your API key in an encrypted vault or secrets manager. Never store API keys in code or plain/text files.

# Linux and macOS
export CECIL_API_KEY="my-api-key"

# Windows
set CECIL_API_KEY=my-api-key

Usage

All SDK functions require authentication unless otherwise specified.

import cecil

client = cecil.Client()

client.function_name()

AOI

The area of interest (AOI) represents a geographic area. See AOI restrictions for all datasets.

Property Type Default value Description
id uuid Generated by Cecil Unique identifier.
geometry required object GeoJSON geometry object in EPSG:4326 delimiting the boundary.
external_ref string External reference in your system, e.g. AOI ID or name.
hectares float Derived from the geometry Total size in hectares. This is useful for cost tracking.
created_at datetime Current system time Timestamp in UTC when the AOI was created.
created_by uuid Authenticated user ID User who created the AOI.

Geometry

The GeoJSON geometry object in EPSG:4326 delimiting the boundary of the AOI.

Property Type Default value Description
type required string Polygon or MultiPolygon.
coordinates required list of coordinates Nested array of coordinates.

Create AOI

This function allows you to create an AOI.

Input

client.create_aoi(
    external_ref="123",
    geometry={
        "type": "Polygon",
        "coordinates": [
            [
                [132.52934211276073, -12.721072673008706],
                [132.52934211276073, -12.730063400794094],
                [132.54027735328083, -12.730063400794094],
                [132.54027735328083, -12.721072673008706],
                [132.52934211276073, -12.721072673008706],
            ],
        ],
    },
)