Skip to main content

A python wrapper around the HyP3 API

Project description

HyP3 SDK

A python wrapper around the HyP3 API

Usage

The HyP3 object

Interactions with the Hyp3 api are done using an instance of the HyP3 class.

from hyp3_sdk import HyP3

api = HyP3()  # Must have credentials for urs.earthdata.nasa.gov in a .netrc file for this to work

If you want to use an api other then the one at https://hyp3-api.asf.alaska.edu, then provide the URL (including scheme) as a parameter.

from hyp3_sdk import HyP3

api = HyP3('https://hyp3.example.com')

If you want to pass in a requests Session object for the API to use, first it must be authenticated, and can be passed into the api.

from hyp3_sdk import HyP3

session = ...

api = HyP3(authenticated_session=session)

Getting jobs

The get_jobs method with request all jobs from the api and return them in a list of dictionaries.

from hyp3_sdk import HyP3

api = HyP3()

jobs = api.get_jobs()
Parmaeters:
  • start: datetime -> requests only jobs submitted after given datetime
  • end: datetime -> requests only jobs submitted before given datetime
  • status: str -> request based on status (SUCCEEDED, FAILED, RUNNING, PENDING)
  • name: str -> requests only jobs that have this name

Submitting jobs

The submit_jobs method will submit jobs to the api for processing

from hyp3_sdk import HyP3, make_rtc_gamma_job()

api = HyP3()

jobs = [make_rtc_gamma_job('job_name', 'granule_name')]

api.submit_jobs(jobs)
Parameters
  • jobs: list[Job] -> list of job objects to submit to api

The Job object

Job objects represent a job to be submitted to the API, they are made by calling factory functions

Job factories

  • make_rtc_gamma_job
    Parameters
    • job_name: str -> name of job
    • granule: str -> name of granule to process
    • extra_parameters: dict -> extra parameters and processing options
  • `make_insar_gamma_job
    Parameters
    • job_name: str -> name of job
    • granule1: str -> name of primary granule to process
    • granule2: str -> name of secondary granule to process
    • extra_parameters: dict -> extra parameters and processing options
  • `make_autorift_job
    Parameters
    • job_name: str -> name of job
    • granule1: str -> name of primary granule to process
    • granule2: str -> name of secondary granule to process
    • extra_parameters: dict -> extra parameters and processing options

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

hyp3_sdk-0.2.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

hyp3_sdk-0.2.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file hyp3_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: hyp3_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.6

File hashes

Hashes for hyp3_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8bb982121bd6f3823bc705466b91bbe27139d1d521445cd60d158ed79d9dabd7
MD5 85b6c9261d5b4c24250907b88802e6f5
BLAKE2b-256 c7c5cb225c8a79f8a76f95aaf2d94d36db30cdf7c502f4f418acc7a328c7e79e

See more details on using hashes here.

File details

Details for the file hyp3_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: hyp3_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.6

File hashes

Hashes for hyp3_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6e07554d19356f65d91f1909d04c6c79ab2e2257294eff101bf3bf9b86903ca
MD5 120fe9c0396efa8d005a0bac35e5c4e0
BLAKE2b-256 e2667a8dffb79a3319a5cb897673443baad0dff416783eb5a8b949eb00dbaf0b

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