Skip to content

About

Official Anedya SDK for Python

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

PyPI  Anedya Documentation

Logo

Anedya Nexus SDK for Python

The Anedya Nexus SDK lets Python applications communicate with Anedya Cloud, including from within a spark function runtime. It currently provides a synchronous client for submitting variable readings over gRPC (the default) or HTTP.

Install

pip install anedya-nexus-sdk

Quick start

Set your API key in the environment rather than hard-coding it in your application:

export ANEDYA_API_KEY="your-api-key"

Note:

If initializing the SDK from a Spark function, SDK automatically inherits the authentication context from the Spark runtime, so you do not need to set an API key in that case.

Then submit a variable reading:

import time

from anedya.nexus import AnedyaClient, VariableReading

reading = VariableReading(
    node_id="your-node-id",
    variable="temperature",
    timestamp=int(time.time() * 1000),
    float_value=23.5,
)

with AnedyaClient() as client:
    response = client.data_management.submit_data(reading)

if not response.success:
    raise RuntimeError(
        f"Data submission failed: {response.error_message} "
        f"({response.reason_code})"
    )

timestamp is a Unix timestamp in milliseconds. You can also pass an API key directly with AnedyaClient(api_key="...").

To configure a custom domain, pass base_url to AnedyaClient. To use HTTP instead of gRPC, pass transport="http".

Links

About

Official Anedya SDK for Python

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages