Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

14 Commits

Repository files navigation

Telemetry-sh

A simple telemetry logging SDK for Python.

Installation

You can install the package using pip:

pip install telemetry-sh

Usage

Initialization

First, you need to initialize the SDK with your API key.

fromtelemetry_shimportTelemetrytelemetry=Telemetry()
telemetry.init("your_api_key")

Logging Data

You can log data to a specified table.

data= {
"field1": "value1",
"field2": "value2"
}
response=telemetry.log("your_table_name", data)
print(response)

Querying Data

You can query data using a custom query.

query="SELECT * FROM your_table_name WHERE field1 = 'value1'"response=telemetry.query(query)
print(response)

Async usage

If your codebase uses asyncio/async python, you can use TelemetryAsync:

fromtelemetryimportTelemetryAsyncasTelemetrytelemetry=Telemetry()
telemetry.init("your_api_key")

The async SDK has the same structure as the sync one:

data= {
"field1": "value1",
"field2": "value2"
}
response=awaittelemetry.log("your_table_name", data)
print(response)

Similarly for query:

query="SELECT * FROM your_table_name WHERE field1 = 'value1'"response=awaittelemetry.query(query)
print(response)

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages