Skip to main content

Environmental data retrieval API query parser

Project description

Environmental Data Retrieval Query Parser

The OGC API Environmental Data Retrieval query parser makes it easy to parse and use the API query.

Python package Upload Python Package

install

pip install edr-query-parser

Usage

Initiate

from edr_query_parser import EDRQueryParser

edr_query = EDRQueryParser('https://somewhere.com/collections/my_collection/position?coords=POINT(57.819 '
                           '-3.966)&datetime=2019-09-07T15:50-04:00/2019-09-07T15:50-05:00&parameter-name=parameter1,'
                           'parameter2&f=geoJSON&crs=crs86&z=all')

Get the collection name

edr_query.collection_name

returns string of the requested collection

Get the query type

edr_query.query_type

returns string of the query type

Get the requested output format

edr_query.format

returns string of the requested output format

Get the parameter names

if edr_query.parameter_name is not None:
    print('SELECT ' + ",".join(edr_query.parameter_name) + ' from observations')
else:
    print('SELECT * from observations')

returns list of requested parameters

Get the datetime

if edr.is_datetime_interval:
    edr.datetime_from
    edr.datetime_to
else:
    edr.datetime.timestamp()  # e.g. gets the timestamp of the datetime

returns datetime object of the requested datetime

Get the get coords type

edr.coords_type

returns the well-know text coords type

Get the coords coordinates

edr.coords_coordinates

returns the well know text coordinates request

Get the coords dictionary

edr.coords

returns dictionary of the well known text query request

Get the CRS

edr.crs

returns string for the requested CRS

Get instances id

edr.instances_id

returns string of the instances id

Get items id

edr.items_id

returns string of the items id

Get locations id

edr.locations_id

returns string of the locations id

Get z height

edr.z

returns float of the height

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

edr query parser-0.5.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

edr_query_parser-0.5-py3-none-any.whl (15.8 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