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.2.0.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maap_py-4.2.0-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file maap_py-4.2.0.tar.gz.

File metadata

  • Download URL: maap_py-4.2.0.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for maap_py-4.2.0.tar.gz
Algorithm Hash digest
SHA256 17a6b780f606381a1e531e89d2f5857a730b65bee1efe04888f98d1b71cbc1cf
MD5 66e21c35f88ce5bf23a747635532f7f9
BLAKE2b-256 ea76ba194a12f995a1edf927ea87f5d7f7aac78aacee90d019ff6c5a8c9d1e97

See more details on using hashes here.

Provenance

The following attestation bundles were made for maap_py-4.2.0.tar.gz:

Publisher: build-pipeline.yml on MAAP-Project/maap-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file maap_py-4.2.0-py3-none-any.whl.

File metadata

  • Download URL: maap_py-4.2.0-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for maap_py-4.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a76027a893d49dda546a29096a102ccb2fe3f1981f3c98000cffa9cade6861b3
MD5 37ca14ac79333ce1d1d4bd374949087e
BLAKE2b-256 b1cc489f27424422daa49b8038650464736aa4a4c2bd554911887a5b13f7125d

See more details on using hashes here.

Provenance

The following attestation bundles were made for maap_py-4.2.0-py3-none-any.whl:

Publisher: build-pipeline.yml on MAAP-Project/maap-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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