Harmonized Python script for DestinE authentication.
Project description
destinepyauth
A Python library for authenticating against DESP (Destination Earth Service Platform) services.
Installation
pip install destinepyauth
Usage
The main entry point is the get_token() function:
from destinepyauth import get_token
# Authenticate (prompts for credentials if not in environment)
result = get_token("highway")
# Access the token
token = result.access_token
Using with requests
from destinepyauth import get_token
import requests
result = get_token("eden")
headers = {"Authorization": f"Bearer {result.access_token}"}
response = requests.get("https://api.example.com/data", headers=headers)
Using with zarr/xarray (netrc support)
For services like CacheB that work with zarr, you can write credentials to ~/.netrc:
from destinepyauth import get_token
import xarray as xr
# Authenticate and write to ~/.netrc
get_token("cacheb", write_netrc=True)
# Now zarr/xarray will use credentials automatically
ds = xr.open_dataset(
"reference://",
engine="zarr",
backend_kwargs={
"consolidated": False,
"storage_options": {
"fo": "https://cacheb.dcms.destine.eu/path/to/data.json",
"remote_protocol": "https",
"remote_options": {"client_kwargs": {"trust_env": True}},
},
},
)
Available Services
cacheb- CacheB data servicedea- DEA serviceeden- Eden brokerhighway- Highway service (includes token exchange)insula- Insula servicestreamer- Streaming service
Credential Handling
When you call get_token(), the library will prompt for your credentials with masked input
for both username and password - nothing you type will be visible on screen:
from destinepyauth import get_token
result = get_token("highway")
# Username: (hidden input)
# Password: (hidden input)
This ensures credentials cannot be accidentally exposed in terminal logs, screen recordings, or shell history.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file destinepyauth-0.2.3.tar.gz.
File metadata
- Download URL: destinepyauth-0.2.3.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
117aa6174070680df2a614311299a4d7611504f5886ddb19e6864d3138fad44e
|
|
| MD5 |
da92599a37b202cf35dd0ddc52bbde4e
|
|
| BLAKE2b-256 |
e1ac68deff620173efff9bf192c01ea393f4ee667310a9d81e0ce42b79936a37
|
Provenance
The following attestation bundles were made for destinepyauth-0.2.3.tar.gz:
Publisher:
cd.yml on purnelldj/destinepyauth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
destinepyauth-0.2.3.tar.gz -
Subject digest:
117aa6174070680df2a614311299a4d7611504f5886ddb19e6864d3138fad44e - Sigstore transparency entry: 761507783
- Sigstore integration time:
-
Permalink:
purnelldj/destinepyauth@20e21e0c28ed4544d4474313da44069f64a9847b -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/purnelldj
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@20e21e0c28ed4544d4474313da44069f64a9847b -
Trigger Event:
push
-
Statement type:
File details
Details for the file destinepyauth-0.2.3-py3-none-any.whl.
File metadata
- Download URL: destinepyauth-0.2.3-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1ccdcf3c8a55ea87cfac1711073155779d443b899160fc9e54b1d584f5609d3
|
|
| MD5 |
3928eae496aeff8630b9b080ede8e5f3
|
|
| BLAKE2b-256 |
74dc89d96c480a5e11a8d3f028595ba3b1a0ca7818b67cfe89dfd9779ef67b38
|
Provenance
The following attestation bundles were made for destinepyauth-0.2.3-py3-none-any.whl:
Publisher:
cd.yml on purnelldj/destinepyauth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
destinepyauth-0.2.3-py3-none-any.whl -
Subject digest:
d1ccdcf3c8a55ea87cfac1711073155779d443b899160fc9e54b1d584f5609d3 - Sigstore transparency entry: 761507785
- Sigstore integration time:
-
Permalink:
purnelldj/destinepyauth@20e21e0c28ed4544d4474313da44069f64a9847b -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/purnelldj
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@20e21e0c28ed4544d4474313da44069f64a9847b -
Trigger Event:
push
-
Statement type: