Skip to main content

Python client API for interacting with the NASA MAAP API

Project description

Python MAAP Client Library

Python client library that abstracts MAAP API calls including CMR querying, algorithm change management, and HySDS job execution. CMR components in this library are largely derived from the pyCMR library.

Setup

Run:

python setup.py install

Or

pip install -e .

Usage

Populate your MAAP base url into a maap.cfg file, using maap.cfg as a template.

Then, run:

$ python
>>> from maap.maap import MAAP
>>> maap = MAAP()

>>> granules = maap.searchGranule(sitename='lope', instrument='uavsar')
>>> for res in granules:
    print(res.getDownloadUrl())
    res.download()
# results omitted for brevity

Optionally set the MAAP API base URL

Useful for changing the API host during development, you may override the API host using the constructor:

$ python
>>> from maap.maap import MAAP
>>> maap = MAAP(maap_host='custom.maap-project-org')

When left parameter-less, maap-py uses the default setting.

Custom 'Named Attribute' Parameters

Named parameters are recommended as an alternative to CMR's additional attributes as a way to improve usability. This list of attributes is editable in the maap.cfg indexed_attributes setting. E.g.:

"site_name,Site Name,string"

where:

  • site_name is the parameter
  • Site Name is the CMR attribute name
  • string is the parameter type

With named attribute parameters, this query:

lidarGranule = maap.searchGranule(instrument='lvis', attribute='string,Site Name,lope')

Simplifies to:

lidarGranule = maap.searchGranule(instrument='lvis', site_name='lope')

Test

python setup.py test

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

maap_py-4.1.0.tar.gz (25.1 kB view hashes)

Uploaded Source

Built Distribution

maap_py-4.1.0-py3-none-any.whl (30.4 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