OSDU API Client
Project description
Introduction
osdu-client
is a python library implementing a simple OSDU client with an abstracted-out authorization backend.
Instalation
pip install osdu-client
Example
OSDU API client can be adjusted to specific OSDU deployment by defining auth backend according to AuthBackendInterface
methods.
from osdu_client import OSDUAPI
from osdu_client.auth import AuthBackendInterface
class AuthSession(AuthBackendInterface):
base_url = "https://base.url"
default_data_partition_id = "osdu"
default_tenant = "osdu"
authorization_header = {"Authorization": "Bearer access_token"}
def get_sd_connection_params(self):
return {}
auth_backend = AuthSession(
headers={"Authorization": "Bearer XYZ"},
base_url="https://exmaple.com"
)
storage_client = OSDUAPI.client('storage', auth_backend=auth_backend)
response = storage_client.get_record_versions(id="123")
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
osdu_client-1.1.0.tar.gz
(245.8 kB
view hashes)
Built Distribution
osdu_client-1.1.0-py3-none-any.whl
(290.4 kB
view hashes)
Close
Hashes for osdu_client-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2ed2c4967b8572399e28e5e4f95e23758648de4c4d4a5aa7ed0d55552bc3d39 |
|
MD5 | 67366c5193306cd61c9245c0fdb4e75c |
|
BLAKE2b-256 | 5cf0b31bfc59fc65b195e2ad2f40113b4c276f1a55cf1113af781329487179e4 |