OSDU API Client
Project description
Introduction
osdu-client
is a python library implementing a simple OSDU client. With 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 AnyStr, Dict
from osdu_client import OSDUAPI
from osdu_client.auth import AuthBackendInterface
class AuthBackend(AuthBackendInterface):
def __init__(self, headers, osdu_base_url) -> None:
self._headers = headers
self._osdu_base_url = osdu_base_url
def get_headers(self) -> Dict:
return self._headers
def get_osdu_base_url(self) -> AnyStr:
return self._osdu_base_url
def get_sd_connection_string(self, log_level: int = None) -> AnyStr:
return ""
auth_backend = AuthBackend(
headers={"Authorization": "Bearer XYZ"},
osdu_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.1.0.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for osdu_client-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f32ec1c023279d55524f123b2b3b953da9ef4976e7c91fb6fd8ebe896b2f0e9 |
|
MD5 | e7f95d282d0943bf01f15f983fea90c3 |
|
BLAKE2b-256 | d5eac24a77c9903a5b2d0cc7e5d66b13fd85c6f3f020f34f08aae87d99950345 |