A Python SDK for interacting with the Chirpier API.
Project description
Chirpier SDK
The Chirpier SDK for Python is a simple, lightweight, and efficient SDK to emit event data to Chirpier direct from your Python applications.
Features
- Easy-to-use API for sending events to Chirpier
- Automatic batching of events for improved performance
- Automatic retry mechanism with exponential backoff
- Thread-safe operations
- Periodic flushing of the event queue
Installation
Install Chirpier SDK using pip:
pip install chirpier
Getting Started
To start using the SDK, you need to initialize it with your API key.
Here’s a quick example of how to use Chirpier SDK:
from chirpier import Chirpier, Event
# Initialize the client
Chirpier.initialize(api_key="your-api-key", region="us-west")
# Monitor the event
try:
Chirpier.monitor(Event(
group_id="bfd9299d-817a-452f-bc53-6e154f2281fc",
stream_name="My measurement",
value=1
))
except (ConnectionError, HTTPError) as e:
print(f"Failed to send event: {e}")
API Reference
Initialize
Initialize the Chirpier client with your API key and region. Find your API key in the Chirpier Integration page.
Chirpier.initialize(api_key="your-api-key", region="us-west")
your-api-key(str): Your Chirpier integration keyregion(str): Your local region - options areus-west,eu-west,asia-southeast
Event
All events emitted to Chirpier must have the following properties:
event = Event(
group_id="bfd9299d-817a-452f-bc53-6e154f2281fc",
stream_name="My measurement",
value=1
)
group_id(str): UUID of the monitoring groupstream_name(str): Name of the measurement streamvalue(float): Numeric value to record
Monitor
Send an event to Chirpier using the monitor function.
Chirpier.monitor(event)
Test
Run the test suite to ensure everything works as expected:
pytest tests/
Contributing
We welcome contributions! To contribute:
- Fork this repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a clear explanation of your changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
If you have any questions or need support, please open an issue on the GitHub repository or contact us at contact@chirpier.co.
Start tracking your events seamlessly with Chirpier SDK!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chirpier-0.0.6.tar.gz.
File metadata
- Download URL: chirpier-0.0.6.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.11.3 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8f45fb3fa3e6bd0d3f7e2eb967ab612aec603048264054b3b9e7789891b95ab
|
|
| MD5 |
5db89c74e912ab99ab05786ab2929365
|
|
| BLAKE2b-256 |
e0e7582e740a721512e91e3599be88b1f9c5062181fc4c36672492eff7900146
|
File details
Details for the file chirpier-0.0.6-py3-none-any.whl.
File metadata
- Download URL: chirpier-0.0.6-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.11.3 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db112f612608f1bfc862296ca552c660a7c8c140955217d76e62a10775ae6c15
|
|
| MD5 |
e7857ccf52ca420a8c52572ec6778285
|
|
| BLAKE2b-256 |
36e4e66c9fcf72588a3dbda8a841af7071c96a8ed51a6fda4af6e53e6c6d3b27
|