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
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
odsl-1.0.10.tar.gz
(11.4 kB
view details)
Built Distribution
odsl-1.0.10-py3-none-any.whl
(11.3 kB
view details)
File details
Details for the file odsl-1.0.10.tar.gz
.
File metadata
- Download URL: odsl-1.0.10.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4086e6fc311de264741efbe12d4994f008aab3c09bb174df5911ec2d6cebfa1e |
|
MD5 | 83991d70d806f7113353e81ca1b829c3 |
|
BLAKE2b-256 | 54f1013e7bb38a3f0c310b8491b2ed7f36b4db9aa21d2d3ab7ec20b0ad1144cd |
File details
Details for the file odsl-1.0.10-py3-none-any.whl
.
File metadata
- Download URL: odsl-1.0.10-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74c67c84c4848f8d80087042267406665b6287e0f0d3c85fca077c44a8b4c2c4 |
|
MD5 | ac12de18246ba9a8086ebd6edffaa029 |
|
BLAKE2b-256 | 5a2487992073504288dbea9e5318fb65053dbecc5190526b5442e286ebc03dbc |