A requests addon for Pelican data federations
Project description
Python-requests interface for Pelican Platform
This project provides requests
addons
to support HTTP requests to a Pelican Federation.
The main component is a new PelicanAdapter
class that handles translating
Pelican URIs into HTTP URLs to enable standard GET
requests, including
looping over Pelican caches.
This project also provides wrappers around requests.get
(and friends) and
requests.Session
to simplify configuring support for Pelican URIs.
Examples
1. Public data
import requests_pelican
print(requests_pelican.get("osdf:///gwdata/zenodo/README.zenodo").text)
2. Private data requiring token authorisation
Requests for data from a Private Pelican federation require a Bearer token.
requests-pelican
will attempt to automatically discover a valid
SciToken before GET
ting the data.
import requests_pelican
print(requests_pelican.get("osdf:///igwn/ligo/README").text)
3. Integrating with other requests plugins
The requests_pelican.PelicanAdapter
object can be integrated with the
standard requests.Session
to simplify combining Pelican support with other
plugins, for example:
from requests_pelican import PelicanAdapter
from igwn_auth_utils import Session
with Session() as sess:
sess.mount("osdf://", PelicanAdapter("osdf"))
resp = sess.get("osdf:///igwn/ligo/README", token_scope="read:/ligo")
...
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
File details
Details for the file requests_pelican-0.1.0.tar.gz
.
File metadata
- Download URL: requests_pelican-0.1.0.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 212f680e71f423ba0a2ebb79f4b4c196b00dc1c083ba09295c842a260abdc90b |
|
MD5 | 00c9f44116a183a10ce47065e61735e6 |
|
BLAKE2b-256 | 1627f7d6c2c0bac8ad841ac9de6f4f3833e637cf45da1c40823e98d68eb338bb |
File details
Details for the file requests_pelican-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: requests_pelican-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9a58c6cd585ec02ac043a5d6ffe24fa13a10b0269a8687542d0a526f020e650 |
|
MD5 | 26e3638813a22cd5b4ea8592e313c99b |
|
BLAKE2b-256 | a791c4f09d1e3cf076367e22b85dfb9e81e5adc9afdff9b18113d1e953f11ffb |