Metadata-Version: 2.1
Name: chirpier
Version: 0.0.6
Summary: A Python SDK for interacting with the Chirpier API.
License: MIT
Author: Chirpier
Author-email: contact@chirpier.co
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: pydantic (>=2.5.2,<3.0.0)
Requires-Dist: requests (>=2.25.1,<3.0.0)
Requires-Dist: retrying (>=1.3.3,<2.0.0)
Description-Content-Type: text/markdown

# 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:

```bash
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:

```python
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.

```python
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:

```python
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.

```python
Chirpier.monitor(event)
```

## Test

Run the test suite to ensure everything works as expected:

```bash
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](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!

