Skip to main content

Python SDK for OpenDataDSL

Project description

ODSL Python SDK

The python SDK for the OpenDataDSL data management platform

Installation

You can install the ODSL Python SDK from PyPI:

python -m pip install odsl

About

This python SDK for OpenDataDSL has the following features:

  • Find any data in OpenDataDSL using the list command
  • Retrieve any data using the get command
  • Update any data (if you have permission) using the update command

Check out our demo repository for examples of real-world usage.

Usage

Logging in and getting started

from odsl import sdk

odsl = sdk.ODSL()
odsl.login()

Logging in using a secret

from odsl import sdk

odsl = sdk.ODSL()
odsl.loginWithSecret(tenantId, clientId, secret)

Finding master data

objects = odsl.list('object', source='public', params={'source':'ECB'})
print(objects[0])

Getting master data

obj = odsl.get('object', 'public', '#ECB')
print(obj['description'])

Getting a timeseries

ts = odsl.get('data', 'public', '#ABN_FX.EURUSD:SPOT', {'_range':'from(2024-07-01)'})
print(ts)

Getting a forward curve

id = '#AEMO.EL.AU.NEM.NSW1.FORECAST:DEMAND:2024-07-15'
curve = odsl.get('data', 'public', id)
for c in curve['contracts']:
	print(c['tenor'] + " - " + str(c['value']))

Updating some private master data

var = {
    '_id': 'AAA.PYTHON',
    'name': 'Python Example'
}
odsl.update('object', 'private', var)

Reading and updating some private master data

po = odsl.get('object', 'private', 'AAA.PYTHON')
po['description'] = 'Updated from Python'
odsl.update('object', 'private', po)

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

odsl-1.0.7.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

odsl-1.0.7-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file odsl-1.0.7.tar.gz.

File metadata

  • Download URL: odsl-1.0.7.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.1

File hashes

Hashes for odsl-1.0.7.tar.gz
Algorithm Hash digest
SHA256 fc2fbaa2a4b9f5f8619fb2ea2bfff8b9cfcea103c38953a25ce2902303cac601
MD5 9303bb87f17606a4150a0192b140fd5c
BLAKE2b-256 dbe5676c746e19f8caea2bdb64afbf9fbc9cd56b98fb14971bc406f68466cca5

See more details on using hashes here.

File details

Details for the file odsl-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: odsl-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.1

File hashes

Hashes for odsl-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 34b4d2668a72c29e6982c531b94d2ace6071372cca1107ad2fa4d53f369c24f7
MD5 0bda886706c0eff6c5fc73e50a5a1b7b
BLAKE2b-256 6179f2e6f7d76feb04ece3a0914ffdc76842fccdc73e5ead9f723adddd654e64

See more details on using hashes here.

Supported by

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