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 typing import Dict
from osdu_client import OSDUAPI
from osdu_client.auth import AuthBackendInterface
class AuthBackend(AuthBackendInterface):
def __init__(self, headers, base_url) -> None:
self._headers = headers
self._base_url = base_url
def get_headers(self) -> Dict:
return self._headers
def get_base_url(self) -> str:
return self._osdu_base_url
def get_sd_connection_params(self, log_level: int = None) -> Dict:
return {}
auth_backend = AuthBackend(
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-0.3.1.tar.gz
(8.3 kB
view hashes)
Built Distribution
Close
Hashes for osdu_client-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a9afef2288f5a81f24373a99c5d8fecd5598b068481c9def3771fd164c70eb7 |
|
MD5 | f7b93d810b057008ab6593f8d7f954a8 |
|
BLAKE2b-256 | 3acc9a6f7512614305388e9c4454eec66a0701e51a734fbcefdc994918aa794d |