Skip to main content

ORPHE ANALYTICIS SDK for Python

Project description

ORPHE ANALYTICIS SDK for Python is a client library that accesses the ORPHE ANALYTICS resource API and real-time API.

Install

You can install ORPHE ANALYTICIS SDK for Python (hereafter intdash-py) using PyPI. Install with the following command.

$ pip install orphe

Usage

To start using ORPHE ANALYTICIS SDK, create a client. To create a client, use the URL of the connection destination and the credentials of the edge account (token or user name/password combination). See intdash client for other available parameters.

import orphe

analytics = orphe.Analytics(
    url = "https://example.analytics.orphe.ai",
    token = "your_token",
)

Example: An example for retrieving and storing a value is given below.

import orphe

# Generate a client with a URL and an edge token
analytics = orphe.Analytics(
    url = "https://example.analytics.orphe.ai",
    token= "your_token"
)
# Get data by specifying the measurement UUID
analyzed = analytics.load(
    measurement_uuid = "e07cdf8c-83e6-46cf-8a03-e315eef6162a",
)

# Extract, analyze and display values
for gait in analyzed.gait.left:
    print(f"left/{gait.time}/{gait.quaternion_w}/{gait.quaternion_x}/{gait.quaternion_y}/{gait.quaternion_z}")

for gait in analyzed.gait.right:
    print(f"right/{gait.time}/{gait.quaternion_w}/{gait.quaternion_x}/{gait.quaternion_y}/{gait.quaternion_z}")

# To save the value, use [orphe.Unit]
units = []
for gait in analyzed.gait.left:
    units.append(orphe.Unit(
        time = gait.time,
        id = "Height",
        value = 160
    ))

# Save the data by specifying the measurement UUID and the list of [orphe.Unit].
analytics.save(
    measurement_uuid="e07cdf8c-83e6-46cf-8a03-e315eef6162a",
    units=units
)

After analytics.load is performed, the retrieved valuesanalyzed will contain the values retrieved from ORPHE CORE and the values analyzed by ANALYTICS. By gait, the data of gait analysis is retrieved, and left and right data can be retrieved respectively.

In addition, if you want to perform real-time analysis, you can use the following method.

import orphe

# Generate a client with a URL and an edge token
analytics = orphe.Analytics(
    url = "https://example.analytics.orphe.ai",
    token= "your_token"
)

# Defines a callback for realtime. [value] will contain the raw and parsed data.
def callback(value : orphe.AnalyticsValue) -> None:
    if value.gait.left.stride != None:
        print(value.gait.left.stride)
    if value.gait.left.euler_x != None:
        print(value.gait.left.euler_x)

# Start real-time acquisition by specifying the callback and the ID of the edge.
analytics.realtime(
    callback = callback,
    edge_uuid="08058fc6-3374-407a-b9ed-fcbe81217ac9",
)

Documentation

Documentation and links to additional resources are available at https://analytics.orphe.ai

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

orphe-0.0.2.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

orphe-0.0.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file orphe-0.0.2.tar.gz.

File metadata

  • Download URL: orphe-0.0.2.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for orphe-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c8f9851ae7280372db7532adc2ea4dfc9a2d16f265c0bc58da089eacdac2ceb4
MD5 a13a80b69cd3b951362f049747ed9436
BLAKE2b-256 6deceac3f0d2fca679efdd10809f8e4a5f329dafb3e2a574185093d986418992

See more details on using hashes here.

File details

Details for the file orphe-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: orphe-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for orphe-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6bc8ad1c3a5983c1ab1d92a9ea2ca39259399e8f4f6566b2d0a236e5e00357d7
MD5 f3af8e525e7d01eba0bfa57f66c88a4e
BLAKE2b-256 9e2fb723ecec9e449167219f59759bfed56d8cc0c28712db0c2eae2f92e7e88a

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