Skip to main content

Python package for request and download data from CCSI

Project description

ptr-metagen

Description

Python package for request and download data from CCSI

Install

pip install pyccsi

Usage

Import of the downloader class

from pyccsi import CCSIDownloader

Initialization of the downloader class. Class expecting only one parameter that is the base/host url of CCSI server instance

ccsi = CCSIDownloader(host_url="http://localhost:5000")

Downloader method 'send_request' send the request on the CSSI resource endpoin vis. host_url/:resource/...

Available resources name can be get via get request on the resource parameters endpoint vis. host_url/resources/parameters

Parameter params is a dict of resource parameters in the form of dictionary od pydantic base model. Parameters of given resource endpoint are show on resource OpenSearch description dokument vis. host_url/:resource/atom/search/description.xml

ccsi.send_request(resource=resource, params=params)

Send request can return list of the record requested from the CCSI for aditional sorting and manipulation

####Example of params dictionary resource: cds_er5

    {
        'timeStart': '2021-01-01',
        'timeEnd': '2021-01-10',
        'bbox': '25.067713534286536,35.298035029324204,25.193195594830012,35.347934920842974',
        'custom:camsDataset': 'total_column_water_vapour,10m_u_component_of_wind',
        'custom:hour': '03:00,06:00',
        'custom:format': 'grib'
    }

Second downloader method download accept the path of the folder where the data will be downloaded.

ccsi.download(path=output_directory)

Optionaly custom list of the records can be set in the method

ccsi.download(path=output_directory, records=records)

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

pyccsi-1.0.1.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

pyccsi-1.0.1-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

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