Skip to main content

harmony-py

Documentation Status

Harmony-Py is a Python library for integrating with NASA's Harmony Services.

Harmony-Py provides a Python alternative to directly using Harmony's OGC Coverage RESTful API and Harmony's OGC EDR RESTful API. It handles NASA Earthdata Login (EDL) authentication and optionally integrates with the CMR Python Wrapper by accepting collection results as a request parameter. It's convenient for scientists who wish to use Harmony from Jupyter notebooks as well as machine-to-machine communication with larger Python applications.

We welcome feedback on Harmony-Py via GitHub Issues

Documentation

View the full API documentation on ReadTheDocs →

Using Harmony Py

Prerequisites

  • Python 3.10 through 3.14 (other versions are end of life or untested)

Installing

The library is available from PyPI and can be installed with pip:

    $ pip install -U harmony-py

This will install harmony-py and its dependencies into your current Python environment. It's recommended that you install harmony-py into a virtual environment along with any other dependencies you may have.

Examples & Tutorials

Looking for examples of harmony-py in action? Check out these resources:

Running Examples & Developing on Harmony Py

Prerequisites

  • Python 3.10 through 3.14, ideally installed via a virtual environment

Installing Development & Example Dependencies

  1. Install dependencies:

     $ make install
    
  2. Optionally register your local copy with pip:

     $ pip install -e ./path/to/harmony_py
    

Running the Example Jupyter Notebooks

Jupyter notebooks in the examples subdirectory show how to use the Harmony Py library. Start up the Jupyter Lab notebook server and run these examples:

The Jupyter Lab server will start and open in your browser. Double-click on a notebook in the file-browser sidebar and run the notebook. Note that some notebooks may have cells which prompt for your EDL username and password. Be sure to use your UAT credentials since most of the example notebooks use the Harmony UAT environment.

    $ make examples

Developing

Generating Documentation

Documentation on the Read The Docs site is generated automatically. It is generated by using sphinx with reStructuredText (.rst) and other files in the docs directory. To generate the docs locally and see what they look like:

    $ make docs

You can then view the documentation in a web browser under ./docs/_build/html/index.html.

IMPORTANT: The documentation uses a notebook from the examples directory rendered as HTML. If you've modified that notebook (see Makefile for notebook that is currently rendered), you will need to run make docs locally. You will see a change to the docs/user/notebook.html file after doing so. This file should be committed to the git repo since it is used when the latest docs are pushed to the Read The Docs site (it can't currently be generated as part of the build).

Running the Linter & Unit Tests

Run the linter on the project source:

    $ make lint

Run unit tests and test coverage. This will display terminal output and generate an HTML coverage report in the htmlcov directory.

    $ make test

For development, you may want to run the unit tests continuously as you update tests and the code-under-test:

    $ make test-watch

Generating Request Parameters

The harmony.Request constructor can accept parameters that are defined in the Harmony OGC API schema. If this schema has been changed and the Request constructor needs to be updated, you may run the generator utility. This tool reads the Harmony schema and generates a partial constructor signature with docstrings:

    $ python internal/genparams.py ${HARMONY_DIR}/services/harmony/app/schemas/ogc-api-coverages/1.0.0/ogc-api-coverages-v1.0.0.yml

Either set HARMONY_DIR or replace it with your Harmony project directory path. You may then write standard output to a file and then use it to update the harmony.Request constructor and code.

CI

Harmony-py uses GitHub Actions to run the Linter & Unit Tests. The test coverage output is saved as a build artifact.

Building and Releasing

New versions of Harmony-Py will be published to PyPi via a GitHub action whenever a draft release is marked as published https://github.com/nasa/harmony-py/releases.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

harmony_py-1.5.0.tar.gz (592.4 kB view details)

Uploaded Source

Built Distribution

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

harmony_py-1.5.0-py3-none-any.whl (583.7 kB view details)

Uploaded Python 3

File details

Details for the file harmony_py-1.5.0.tar.gz.

File metadata

  • Download URL: harmony_py-1.5.0.tar.gz
  • Upload date:
  • Size: 592.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for harmony_py-1.5.0.tar.gz
Algorithm Hash digest
SHA256 ec167a80e5f567483471f29dcd5b341b4057d7948c900b29e69c8fec455f7f41
MD5 b42e54842f35859424a636fdb7336a9c
BLAKE2b-256 073a82037cc068bde76b7a6a4b55fa882157605d67c3f3c22902db036649cc6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for harmony_py-1.5.0.tar.gz:

Publisher: publish-release.yml on nasa/harmony-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 harmony_py-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: harmony_py-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 583.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for harmony_py-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 320834a09183290a792d037e038c8fcade57dbfdc01339a83f44b82f6e526d87
MD5 8e9a7441cf89f1ef96caf5ed841e49b1
BLAKE2b-256 383dd79ce25a65348bd7d2bb70d3d4526a6e19e2ad1517fb15869fcba9de0aed

See more details on using hashes here.

Provenance

The following attestation bundles were made for harmony_py-1.5.0-py3-none-any.whl:

Publisher: publish-release.yml on nasa/harmony-py

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

Release history Release notifications | RSS feed

1.6.0

2 files

This release

1.5.0 This release

2 files

1.4.0

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.15

2 files

0.4.14

2 files

0.4.13

2 files

0.4.12

2 files

0.4.11

2 files

0.4.10

2 files

0.4.9

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

Supported by

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