Skip to main content

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.

Installation

From PyPI (recommended)

pip install maap-py

For development

pip install -e .

Legacy

python setup.py install

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

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.0.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.0-py3-none-any.whl (45.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for maap_py-5.1.0.tar.gz
Algorithm Hash digest
SHA256 15154c73f9e123eb2192ae900ebea5d11c601a5f37c1862b7fb4720cda5d8ac1
MD5 d70d779776a008c9d9c58a09ddeb2635
BLAKE2b-256 afe1212133b17658e4c76855b44b85da6f09f7a9fb0b576852d6f72f83b3a770

See more details on using hashes here.

File details

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

File metadata

  • Download URL: maap_py-5.1.0-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.0

File hashes

Hashes for maap_py-5.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 306e73d4ee4e8582739d6c02df0ca4af3efd782d92356d867ea49859b103976d
MD5 3913bf50b0b651e393f84dc488721646
BLAKE2b-256 50bca8f7b35553a74738e8f9e4c399d9874f38a71bc15699bcced007be33df5b

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 Sentry Error logging StatusPage Status page