Metadata-Version: 2.4
Name: ddc-utility
Version: 1.7.1
Summary: Client package for the DDC API.
Author-email: Balint Alfoldy <balint.alfoldy@cropom.com>, Peter Hazi <peter.hazi@cropom.com>, Marton Tolnai <marton.tolnai@cropom.com>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: dask>=2023.1.1
Requires-Dist: Jinja2>=3.1.2
Requires-Dist: matplotlib>=3.6.2
Requires-Dist: numcodecs>=0.11.0
Requires-Dist: pyproj>=3.4.1
Requires-Dist: requests>=2.28.2
Requires-Dist: xarray>=2023.1.0
Requires-Dist: zarr>=2.13.6
Requires-Dist: fsspec
Requires-Dist: s3fs
Requires-Dist: shapely
Requires-Dist: pydantic>=2.8.0
Dynamic: license-file

# DDC Utility

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

### Installation

```bash
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)

```
