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)

Logging in using an API Key

from odsl import sdk

odsl = sdk.ODSL()
odsl.loginWithAPIKey(userid, apikey)

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

Uploaded Source

Built Distribution

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

odsl-1.0.11-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for odsl-1.0.11.tar.gz
Algorithm Hash digest
SHA256 2c7f15462a4a6e3e91e76abf710587d1c8d0404bb9fe5263c5a44a79c9ad3b21
MD5 c689b55afe25ec6651b955c93db434de
BLAKE2b-256 9f5e2227dba9615294227aafff3d27e5e9dc8c3e18941cd9764fd58c4c412a79

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for odsl-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 fb04688c650da74d2a103b1924dcaabb154ff60d9e2de3aeabf7cdfeb5212b97
MD5 6e7000bb0f2a9a3f2e603c811b8121d2
BLAKE2b-256 d5126da82afab35d240a75420bc38c2b48887c97499c3a07df5d754f3ee8feac

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