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.
Install
To install this project, use pip:
pip install requests-pelican
To include support for SciTokens
include the [scitokens] extra:
pip install requests-pelican[scitokens]
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 GETting 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")
...
Metadata
Release files for requests-pelican 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| requests_pelican-0.2.0.tar.gz | 22.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| requests_pelican-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.7 kB
Release files / requests_pelican-0.2.0.tar.gz
| Download URL | requests_pelican-0.2.0.tar.gz |
|---|---|
| Size | 22.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1893cd78d0c8478555662bf3102ee722548cb4cae05945911775a2d0677e273
|
|
BLAKE2b-256 checksum How to use checksums |
a867ff53679a8bfd2e6434d320c8847d9480c349b8ab3b5e3657d78a6c383db3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / requests_pelican-0.2.0-py3-none-any.whl
| Download URL | requests_pelican-0.2.0-py3-none-any.whl |
|---|---|
| Size | 20.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4f4aab8c9a6c1f6a72271ce5e78836161159e52f65b791746a83931c835f26c
|
|
BLAKE2b-256 checksum How to use checksums |
978d17e56f2208b885aa8462277ae75a9bc82f7877bb52d88690636246853032
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|