Skip to main content

SDK for the SmartOcean Platform Data Space Service

Project description

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.

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

sfisop_dataspace_sdk-1.0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

sfisop_dataspace_sdk-1.0.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file sfisop_dataspace_sdk-1.0.1.tar.gz.

File metadata

  • Download URL: sfisop_dataspace_sdk-1.0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/24.2.0

File hashes

Hashes for sfisop_dataspace_sdk-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5eaf447f910a90e6f0f668471c78c97f213066c2b06922d98db9318bce0f8e50
MD5 f3f8c73ff8fa7e3415572754cc73e6b8
BLAKE2b-256 efa0cfaad97eb62733320efd81a281f11587557e09ac0cb0035d165657c6bc15

See more details on using hashes here.

File details

Details for the file sfisop_dataspace_sdk-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sfisop_dataspace_sdk-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6246d126828ac3318d2b376b312c1ff3bc23316ab2e514a7375abf67c0a246d3
MD5 c09a4d0f36d776942c36d48b0ea91338
BLAKE2b-256 e13470c1c073cd11c7f15598c7ff8a8d4d05778f4bf2458f9f1fa23bbba7632b

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