Skip to main content

Python SDK for Cecil Earth

Project description

Cecil SDK

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install cecil

Authentication

Set CECIL_API_KEY environment variable to your Cecil API key.

Examples

Create an AOI and data request using the Cecil client

import cecil

client = cecil.Client()

my_aoi = client.create_aoi(
    name="My AOI",
    geometry={
        "type": "Polygon",
        "coordinates": [
            [
                [145.410408835, -42.004083838],
                [145.410408835, -42.004203978],
                [145.410623191, -42.004203978],
                [145.410623191, -42.004083838],
                [145.410408835, -42.004083838],
            ]
        ],
    },
)

# Get dataset ID from docs.cecil.earth -> Datasets
planet_forest_carbon_diligence_id = "c2dd4f55-56f6-4d05-aae3-ba7c1dcd812f"

my_data_request = client.create_data_request(
    aoi_id=my_aoi.id,
    dataset_id=planet_forest_carbon_diligence_id,
)

print(client.get_data_request(my_data_request.id))

Create a transformation using the Cecil client

my_transformation = client.create_transformation(
    data_request_id=my_data_request.id,
    crs="EPSG:4326",
    spatial_resolution=0.005,
)

print(client.get_transformation(my_transformation.id))

Query data (once transformation is completed)

df = client.query(f'''
    SELECT *
    FROM
        planet.forest_carbon_diligence
    WHERE
        transformation_id = '{my_transformation.id}'
''')

Other client methods:

client.list_aois()

client.get_aoi(my_aoi.id)

client.list_data_requests()

client.get_data_request(my_data_request.id)

client.list_transformations()

client.get_transformation(my_transformation.id)

License

cecil is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cecil-0.0.24.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cecil-0.0.24-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file cecil-0.0.24.tar.gz.

File metadata

  • Download URL: cecil-0.0.24.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for cecil-0.0.24.tar.gz
Algorithm Hash digest
SHA256 7e76faa8d8d05fa1a466a255a09ebc2cda9b9704aaee1bfe937100900297e020
MD5 2c636bfcfd11dc0ef57b3d390cf6f6f6
BLAKE2b-256 028ec6df2c9df3533bf87f0c2c8f2ff05443021d08ff4890f36db34aaf22af8c

See more details on using hashes here.

File details

Details for the file cecil-0.0.24-py3-none-any.whl.

File metadata

  • Download URL: cecil-0.0.24-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for cecil-0.0.24-py3-none-any.whl
Algorithm Hash digest
SHA256 9d1a152c76f245b5ec80c4ebd201a1b8f70409c05f446a07fc6aa80ff802766a
MD5 5609cd3c6c61747e178cb42967a67238
BLAKE2b-256 0020301e6b1d78f7eef959afb261d4ca0d1b3456a80cddfeaee125915e635e72

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page