Skip to main content

OSDU API Client

Project description

Introduction

pypi

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"
    
    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")

Available services

from osdu_client.client import OSDUAPI
OSDUAPI.print_available_services()
|      Name      |    Versions    |
===================================
|    dataset     |     latest     |
|  entitlements  |     latest     |
|      file      |     latest     |
|    indexer     |     latest     |
|     legal      |     latest     |
|  notification  |     latest     |
|   partition    |     latest     |
|     policy     |     latest     |
|      pws       |     latest     |
|      rafs      |     v1, v2     |
|    register    |     latest     |
|     schema     |     latest     |
|      sdms      |     latest     |
|     search     |     latest     |
|     secret     |     latest     |
|    storage     |     latest     |
|    wellbore    |     v2, v3     |
|  welldelivery  |     latest     |

Project details


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.4.0.tar.gz (269.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

osdu_client-1.4.0-py3-none-any.whl (323.5 kB view details)

Uploaded Python 3

File details

Details for the file osdu_client-1.4.0.tar.gz.

File metadata

  • Download URL: osdu_client-1.4.0.tar.gz
  • Upload date:
  • Size: 269.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.8.18 Linux/6.5.0-1025-azure

File hashes

Hashes for osdu_client-1.4.0.tar.gz
Algorithm Hash digest
SHA256 e8bbbb37092ca8ef6a857a578fb7c08b41b66ac3196ca18612f38a8f1c88354a
MD5 60aefd7b5e7c9e893f0c9f2f882cf69b
BLAKE2b-256 cd969fe2641b8bf6e544cc78d0810a8662eb132ac3541d27ad4cd962a121d953

See more details on using hashes here.

File details

Details for the file osdu_client-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: osdu_client-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 323.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.8.18 Linux/6.5.0-1025-azure

File hashes

Hashes for osdu_client-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d30488784a3f9393e1e802e0f175bb436b8839eb9a1802476c09f535eef7db56
MD5 bfe21802efed49f4fe912d016c970d76
BLAKE2b-256 6fa243c70b4ed18305310a160c7d232ba2b5ec749f9e05a0add13f6fe0a43b43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page