Skip to main content

A python wrapper around the HyP3 API

Project description

HyP3 SDK

PyPI license PyPI pyversions PyPI version Conda version Conda platforms

DOI

A python wrapper around the HyP3 API

>>> from hyp3_sdk import HyP3
>>> hyp3 = HyP3(username='MyUsername', password='MyPassword')

>>> granule = 'S1A_IW_SLC__1SSV_20150621T120220_20150621T120232_006471_008934_72D8'
>>> job = hyp3.submit_rtc_job(granule=granule, name='MyNewJob')
>>> job = hyp3.watch(job)
>>> job.download_files()

Install

In order to easily manage dependencies, we recommend using dedicated project environments via Anaconda/Miniconda. or Python virtual environments.

The HyP3 SDK can be installed into a conda environment with

conda install -c conda-forge hyp3_sdk

or into a virtual environment with

python -m pip install hyp3_sdk

Quick Usage

There are 3 main classes that the SDK exposes:

  • HyP3 to perform HyP3 operations (find jobs, refresh job information, submitting new jobs)
  • Job to perform operations on single jobs (downloading products, check status)
  • Batch to perform operations on multiple jobs at once (downloading products, check status)

An instance of the HyP3 class will be needed to interact with the external HyP3 API.

>>> from hyp3_sdk import HyP3
>>> hyp3 = HyP3(username='MyUsername', password='MyPassword')

>>> granule = 'S1A_IW_SLC__1SSV_20150621T120220_20150621T120232_006471_008934_72D8'
>>> job = hyp3.submit_rtc_job(granule=granule, name='MyNewJob')
>>> job = hyp3.watch(job)
>>> job.download_files()

Submitting Jobs

hyp3 has member functions for submitting new jobs:

rtc_job = hyp3.submit_rtc_job('granule_id', 'job_name')
insar_job = hyp3.submit_insar_job('reference_granule_id', 'secondary_granule_id', 'job_name')
autorift_job = hyp3.submit_autorift_job('reference_granule_id', 'secondary_granule_id', 'job_name')

Each of these functions will return an instance of the Job class that represents a new HyP3 job request.

Finding Existing Jobs

To find HyP3 jobs that were run previously, you can use the hyp3.find_jobs()

batch = hyp3.find_jobs()

This will return a Batch instance representing all jobs owned by you. You can also pass parameters to query to a specific set of jobs

Operations on Job and Batch

If your jobs are not complete you can use the HyP3 instance to update them, and wait from completion

batch = hyp3.find_jobs()
if not batch.complete():
    # to get updated information
    batch = hyp3.refresh(batch)
    # or to wait until completion and get updated information (which will take a fair bit)
    batch = hyp3.watch(batch)

Once you have complete jobs you can download the products to your machine

batch.download_files()

These operations also work on Job objects

job = hyp3.submit_rtc_job('S1A_IW_SLC__1SSV_20150621T120220_20150621T120232_006471_008934_72D8', 'MyJobName')
job = hyp3.watch(job)
job.download_files()

Documentation

For the full SDK API Reference, see the HyP3 documentation

Contact Us

Want to talk about the HyP3 SDK? We would love to hear from you!

Found a bug? Want to request a feature? open an issue

General questions? Suggestions? Or just want to talk to the team? chat with us on gitter

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-1.2.0.tar.gz (34.5 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-1.2.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hyp3_sdk-1.2.0.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6

File hashes

Hashes for hyp3_sdk-1.2.0.tar.gz
Algorithm Hash digest
SHA256 0f6ad0dcd0fbb5e82857b9ca1bd7e4eedb76ac2a4bc19caa37ca1dea02aa0066
MD5 482a17b34921957be2a7f7ccad63d117
BLAKE2b-256 25265b2bf7f3f896550917053f515ea4da59fde248ba20f9f6445ae375435683

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hyp3_sdk-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6

File hashes

Hashes for hyp3_sdk-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a36f005110ccfaf7c6b6d36c3f823f2e2f2a1b5cc9e39481fa917fdb8108b64d
MD5 7288a8a9476bcad81aeb312ca827d78a
BLAKE2b-256 b12b36b3fff6f549a7d3bcb5895058471ced85b081ea3bbfadefc40561412d3a

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