Skip to main content

Data Space Service Client SDK

Basic client library for accessing the SmartOcean data space service to retrieve historical time series data from data sources.

Data Space Service REST API

The SmartOcean dataspace service provides a REST API.

Sample Client Code

A sample implementation of the client-side code is provided in the main.py file.

import datetime

from sfisop.dataspace_sdk.client import DataSpaceClient
from sfisop.dataspace_sdk.config import get_dataspace_config, get_dataspace_configfile
from sfisop.dataspace_sdk import sop_datasources as data_sources

if __name__ == '__main__':

    config_file = get_dataspace_configfile("DataSpace Configuration")
    dataspace_config = get_dataspace_config(config_file)

    client = DataSpaceClient(dataspace_config)

    response_latest = client.get_latest(data_sources.HVLVIRTUAL)
    print(response_latest.status_code)
    print(response_latest.text)

    start_time = datetime.datetime(2024, 6, 1, 0, 0, 0)
    end_time = datetime.datetime(2024, 6, 7, 0, 0, 0)

    response_period = client.get_period(data_sources.HVLVIRTUAL, start_time, end_time)
    print(response_period.status_code)
    print(response_period.text)

It can be executed as:

python client.py <path-to-configuration-file>

The code is to be used as a starting point for the implementation of the client applications.

A configuration file that can be used for the SmartOcean data space service can be found in the configs folder.

The data sources are currently available on the SmartOcean platform for demonstration purposes can be found in the sop_datasources.py file.

Configuration and credentials

The configuration file provided as on the command-line must contain the following information:

DATASPACE_BASE_URL: <base-url-for-dataspace-service>
DATASPACE_API_KEY_ID: DATASPACE_API_KEY

where the DATASPACE_API_KEY is the API key identifier that is contained in an .env file that must contain the following information:

DATASPACE_API_KEY = '<api-key>'

This indirect configuration of the API key makes it possible to share a single .env file for credentials across different deployments of the data space service.

The API key must be obtained from the SmartOcean data space service.

Release files for sfisop-dataspace-sdk 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sfisop-dataspace-sdk 1.0.1
File Size Uploaded
sfisop_dataspace_sdk-1.0.1.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sfisop-dataspace-sdk 1.0.1
File Interpreter ABI Platform
sfisop_dataspace_sdk-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 kB

Release files / sfisop_dataspace_sdk-1.0.1.tar.gz

Download URL sfisop_dataspace_sdk-1.0.1.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5eaf447f910a90e6f0f668471c78c97f213066c2b06922d98db9318bce0f8e50
BLAKE2b-256 checksum
How to use checksums
efa0cfaad97eb62733320efd81a281f11587557e09ac0cb0035d165657c6bc15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.13.0 Darwin/24.2.0

Release files / sfisop_dataspace_sdk-1.0.1-py3-none-any.whl

Download URL sfisop_dataspace_sdk-1.0.1-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6246d126828ac3318d2b376b312c1ff3bc23316ab2e514a7375abf67c0a246d3
BLAKE2b-256 checksum
How to use checksums
e13470c1c073cd11c7f15598c7ff8a8d4d05778f4bf2458f9f1fa23bbba7632b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.13.0 Darwin/24.2.0

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page