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.search_granule(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.search_granule(instrument='lvis', attribute='string,Site Name,lope')

Simplifies to:

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

Test

poetry install
poetry run pytest --cov=maap
poetry run pytest test/specific_test.py

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-5.1.0a2.tar.gz (38.5 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-5.1.0a2-py3-none-any.whl (45.9 kB view details)

Uploaded Python 3

File details

Details for the file maap_py-5.1.0a2.tar.gz.

File metadata

  • Download URL: maap_py-5.1.0a2.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for maap_py-5.1.0a2.tar.gz
Algorithm Hash digest
SHA256 bfe82eeed593cffc5e8344ae1d3e21bee70a3f64bcf69f0638c3154f098d1024
MD5 59cfadd3225f2d0741d5bc5c9976e2fd
BLAKE2b-256 0061ce2cd00cda6d3ea597cea85a827d55b819e9ed958612d8b9a9726ab6ea5b

See more details on using hashes here.

File details

Details for the file maap_py-5.1.0a2-py3-none-any.whl.

File metadata

  • Download URL: maap_py-5.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 45.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for maap_py-5.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 561697b2761ee9461bcccc71fff8a3d5cf7f8b2d51b9c138223d8d8b4c37c6fb
MD5 3fc508a76a1792138acd0b8a6f1e0efd
BLAKE2b-256 dc96852390249a857aabcf92959d9e975c884b8ca4c26b09267d09a55e6a43dd

See more details on using hashes here.

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