- Home
- Documentation
- API reference
- Archive
- hyperproc.archive.api
hyperproc.archive.api¶
Source-derived reference
Generated from the current hyperproc 0.1.2 checkout.
Implementation: hyperproc/archive/api.py. Signatures, defaults, docstrings, and expandable source are extracted statically; the module is not imported or executed. Names beginning with _ are implementation details, not a stable public API.
Use the function signature as the authority for individual parameter defaults and return annotations. Original docstrings sometimes group parameter names or wrap return descriptions across lines; these descriptions are preserved rather than inferred or rewritten.
One search and one download over three archives.
The backend is decided by what you asked for, not by which function you called:
:func:hyperproc.search looks the (sensor, level) pair up in
:data:hyperproc.archive.COLLECTIONS and hands the query to CMR, NEON or DLR.
The three return the same :class:~hyperproc.archive.results.Granule, so the
rest of a workflow does not care which answered.
_BACKEND = {'cmr': cmr, 'neon': neon, 'dlr': dlr}
module-attribute
¶
_DOWNLOAD_ARGS = {'cmr': (), 'neon': ('token', 'pattern'), 'dlr': ('user', 'password', 'accept_policy')}
module-attribute
¶
search(sensor: str, level: str | None = None, **kwargs) -> Results
¶
Find granules in whichever archive publishes them.
| PARAMETER | DESCRIPTION |
|---|---|
sensor
|
TYPE:
|
level
|
TYPE:
|
bbox
|
|
date
|
|
cloud
|
|
count
|
cap on results, default 100.
|
verbose
|
print the query and the total.
|
Backend-specific arguments are accepted too and documented on the backend:
version= (CMR), site= and site_radius_km= (NEON), assets=
(DLR).
| RETURNS | DESCRIPTION |
|---|---|
Results
|
class: |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
for a sensor no archive here carries, with the address of the archive that does. |
Source code in hyperproc/archive/api.py
download(results, out_dir: str | Path = 'data', workers: int = 8, *, token: str | None = None, user: str | None = None, password: str | None = None, pattern: str | None = None, accept_policy: bool = False, verbose: bool = True) -> list[Path]
¶
Fetch what a search found, from whichever archives it came from.
| PARAMETER | DESCRIPTION |
|---|---|
results
|
a :class:
|
out_dir
|
created if missing. Everything lands flat, which is what the readers expect - they find a granule's siblings by name.
TYPE:
|
workers
|
parallel connections.
TYPE:
|
token
|
NEON API token, else
TYPE:
|
user, password
|
DLR EOC account, else
|
pattern
|
NEON only - which files inside a site-month delivery to take.
TYPE:
|
accept_policy
|
DLR only - agree to its Acceptable Usage Policy from
here. Left
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[Path]
|
the downloaded paths. |
Credentials differ by archive and none of them are needed to search: Earthdata for EMIT, PACE and AVIRIS; a NEON API token since June 2026; a DLR EOC account for EnMAP and DESIS. Each backend raises with its own registration address when it has none.
Source code in hyperproc/archive/api.py
credentials() -> dict[str, bool]
¶
Which archives this process could download from. Never returns a secret.
The DLR entries are per mission, because DLR grants EnMAP and DESIS separately and an account for one need not open the other. A single "have I got DLR credentials" flag reads True when you hold only one of them, and then waves the other through to a refusal.
>>> hp.archive.credentials()
{'cmr': True, 'neon': False, 'ENMAP': False, 'DESIS': True}
Source code in hyperproc/archive/api.py
can_download(sensor: str, level: str | None = None) -> bool
¶
Could this process fetch bytes for this collection, as things stand?
Answers the question :func:download would otherwise answer by failing.
Says nothing about whether the account is cleared for the data - only
DLR can say that, and only when asked.
Source code in hyperproc/archive/api.py
files(results, **kwargs) -> Results
¶
Open a NEON site-month delivery up into the flightlines inside it.
For CMR and DLR a granule already is its files - the links are on it - so this returns what it was given, unchanged. That way one script works against every archive.
See :func:hyperproc.archive.neon.files for token= and pattern=.