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.0.0.tar.gz
(246.3 kB
view hashes)
Built Distribution
osdu_client-1.0.0-py3-none-any.whl
(291.2 kB
view hashes)
Close
Hashes for osdu_client-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97d1185a05a92b5401594d3ec04525d83ccd1b2991353509b37c690b7a0ad8a9 |
|
MD5 | 7a3d0e6a8869a2b1c4b0a5a296b23e0b |
|
BLAKE2b-256 | 75902a95cfcd8e9994a622a708b1faf08e1cf9e14da196931e0b128104178541 |