OSDU SDK for Python


Keywords
osdu, sdk, python
License
MIT
Install
pip install osdu-sdk==0.0.13

Documentation

OSDU SDK for Python

Build License PyPi Version PyPI - Python Version Unknown coverage

This is the OSDU SDK for Python (work in progress).

⚠️ Note that this is a work in progress and is not complete / might contain bugs and might be subject to breaking changes.

Please give your feedback by raising an issue.

Installation

Usage requires that you have a valid python 3.8+ installation on your machine. You might also consider creating a seperate python virtual environment for working with OSDU.

For general usage deploying from PyPi is the easiest and recommended method.

pip install osdu-sdk

If you want to modify the sdk code then see the development wiki for alternative setup steps.

Usage

  1. Import necessary items
from osdu.client import OsduClient
from osdu.identity import OsduTokenCredential, OsduMsalInteractiveCredential, OsduEnvironmentCredential
  1. Create an instance of OsduTokenCredential, OsduMsalInteractiveCredential, OsduEnvironmentCredential or your own custom class.
credential = OsduMsalInteractiveCredential(client_id, authority, scopes, token_cache)
  1. Create a client
client = OsduClient(server, partition, credential)
  1. Use the REST interface to call OSDU API's
response = client.get(client.server_url + '/api/search/v2/health/readiness_check')
print(f"Search service: {response.status_code}\t {response.reason}")

For a full example see examples/example.py

Contributing

We welcome any kind of contribution, whether it be reporting issues or sending pull requests.

When contributing to this repository abide by the Equinor Open Source Code of Conduct.

CLI specific issues and requests

If your issue is relevant to the OSDU CLI, please use this repositories issue tracker.

Be sure to search for similar previously reported issues prior to creating a new one. In addition, here are some good practices to follow when reporting issues:

  • Add a +1 reaction to existing issues that are affecting you
  • Include verbose output (--debug flag) when reporting unexpected error messages
  • Include the version of OSDU SDK for Python installed, pip show osdu will report this
  • Include the version of OSDU you are using

Code changes

See the wiki page on contributing for more information on submitting code changes.