Skip to main content

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-py

Getting Started

To start using the SDK, you need to initialize it with your API key. The SDK works in both browser and Node.js environments.

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}")

Components

Client

  • Initializes the connection with the event tracking service.
  • Uses the region parameter to determine the location of the event tracking service.

Event

  • Represents an event with properties like group_id, stream_name, and value.

Error Handling

  • Custom exceptions to handle and debug errors effectively.

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 key
  • region (str): Your local region - options are us-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 group
  • stream_name (str): Name of the measurement stream
  • value (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:

  1. Fork this repository.
  2. Create a new branch for your feature or bug fix.
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chirpier-0.0.5.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

chirpier-0.0.5-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file chirpier-0.0.5.tar.gz.

File metadata

  • Download URL: chirpier-0.0.5.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.11.3 Darwin/24.3.0

File hashes

Hashes for chirpier-0.0.5.tar.gz
Algorithm Hash digest
SHA256 9c7d3a307122baa92eeb0e1845eb6f1d5bd2459ef8c882fae9ad069757752486
MD5 be6659d056123c0bf42d15ce0eb557b1
BLAKE2b-256 b7e141a3926c34d1994d782de03fecc30b94044d6e4e8f54d3d58a4914ce129a

See more details on using hashes here.

File details

Details for the file chirpier-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: chirpier-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.5 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

Hashes for chirpier-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c8bffc58f9489b736b9901fff1ab18a6c71122761afa1fc39144d70186857331
MD5 7aad65ca738335f0e852d5c73e2248ce
BLAKE2b-256 3fa6cb88111ee3d392f3fdd2d4bfedf1f5b5227917eb060ad1c9b64f832bb2f2

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