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

Installation

pip install cecil

Authentication

Make sure to only store your API key in an encrypted vault, password, or secrets manager. Do not store your API key in your code or plain/text files.

export CECIL_API_KEY="my-api-key"
set CECIL_API_KEY=my-api-key

Usage

import cecil

client = cecil.Client()

client.list_aois()

AOI

The area of interest (AOI) represents a geographic area anywhere globally.

Property Type Default value Description
id string Generated by Cecil Unique identifier.
name required string Human readable name.
geometry required object GeoJSON geometry object delimiting the boundary of the AOI.
hectares float Derived from the geometry Total size in hectares. This is derived from the geometry and used for cost tracking.
created datetime Current time Current system time in UTC when the AOI is created.

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 Maximum of 1,500 vertices.

Create AOI

<aside> <img src="/icons/command-line_gray.svg" alt="/icons/command-line_gray.svg" width="40px" /> create_aoi()

</aside>

Input

client.create_aoi(
    name="Kakadu National Park",
    geometry={
        "type": "Polygon",
        "coordinates": [
            [
                [132.52934211276073, -12.721072673008706],
                [132.52934211276073, -12.730063400794094],
                [132.54027735328083, -12.730063400794094],
                [132.54027735328083, -12.721072673008706],
                [132.52934211276073, -12.721072673008706],
            ],
        ],
    },
)

Output

AOI(
    id="fa200894-4e13-456c-872a-ba8efcda0812",
    name="Kakadu National Park",
    geometry={
        "type": "Polygon",
        "coordinates": [
            [
                [132.52934211276073, -12.721072673008706],
                [132.52934211276073, -12.730063400794094],
                [132.54027735328083, -12.730063400794094],
                [132.54027735328083, -12.721072673008706],
                [132.52934211276073, -12.721072673008706],
            ],
        ],
    },
    hectares=118.12168458669186,
    created=datetime.datetime(2000, 1, 1, 0, 0, 0, 0, tzinfo=TzInfo(UTC)),
)

List AOIs

<aside> <img src="/icons/command-line_gray.svg" alt="/icons/command-line_gray.svg" width="40px" /> list_aois()

</aside>

Input

client.list_aois()

Output

[
    AOI(
        id="fa200894-4e13-456c-872a-ba8efcda0812",
        name="Kakadu National Park",
        geometry={
            "type": "Polygon",
            "coordinates": [
                [
                    [132.52934211276073, -12.721072673008706],
                    [132.52934211276073, -12.730063400794094],
                    [132.54027735328083, -12.730063400794094],
                    [132.54027735328083, -12.721072673008706],
                    [132.52934211276073, -12.721072673008706],
                ],
            ],
        },
        hectares=118.12168458669186,
        created=datetime.datetime(2000, 1, 1, 0, 0, 0, 0, tzinfo=TzInfo(UTC)),
    ),
]