Skip to main content

Client package for the DDC API.

Project description

DDC Utility

This is the Danube Data Cube Utility library, for interacting with the DDC API service.

Installation

pip install ddc-utility

Usage

Users must have a valid DDC registration.

Example

This example walks you through the process of creating and opening an AOI cube.

$ python

# Importing packages
>>> import os
>>> from ddc_utility.client import DdcClient

# Setting DDC credentials
>>> os.environ['DDC_CLIENT_ID'] = "<client id>"
>>> os.environ['DDC_CLIENT_SECRET'] = "<client secret>"

# Initialize DDC client 
>>> client = DdcClient()

# List available data layers
>>> client.get_data_layers()

# List user's AOIs
>>> client.get_all_aoi()

# Create an AOI
>>>  res = client.create_aoi(name="My AOI",
                  geometry="POLYGON ((19.021454 47.507925, 19.043941 47.489601, 19.047031 47.490181, 19.039478 47.506997, 19.021454 47.507925))",
                  time_range=("2023-06-01", "2023-07-01"),
                  layer_ids=[4, 8, 15, 48])
>>> id = res.iloc[0]['id']
                  
# Check if AOI is 'ready'
>>> info = client.get_aoi_by_id(id)
>>> print(f"AOI status is: {info.iloc[0]['status']}")

# If status is 'ready', open cube
>>> ds = client.open_aoi_cube(aoi_id=id)

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

ddc_utility-1.5.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

ddc_utility-1.5.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file ddc_utility-1.5.1.tar.gz.

File metadata

  • Download URL: ddc_utility-1.5.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for ddc_utility-1.5.1.tar.gz
Algorithm Hash digest
SHA256 aa5a8f61c4060ebe1e28e93b9191e712f1ae8ce80cfc491c4dad6f9cb1106cb4
MD5 1cb8f2b061a7e95c04aa64eba6a055d7
BLAKE2b-256 dfaea862981baeb097e845371fa617a4337758ea5f5e6e9add23a664f7ee3e32

See more details on using hashes here.

File details

Details for the file ddc_utility-1.5.1-py3-none-any.whl.

File metadata

  • Download URL: ddc_utility-1.5.1-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for ddc_utility-1.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e4d64d669a4ef0b5313cf0471ed904d1ea7eefd5e6408961ddc20d07d5e5bb4
MD5 9fc4ccf4c4002e3b6e10203656bbc57a
BLAKE2b-256 f7b702333d4ab2c1029cbc58232f618812d488c363d6645f3e043513b3ec8b8e

See more details on using hashes here.

Supported by

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