Metadata-Version: 2.1
Name: avoma-client
Version: 0.1.3
Summary: An unofficial Python client for the Avoma API
Home-page: https://github.com/oztamir/avoma-client
License: MIT
Keywords: avoma,api,client
Author: Oz Tamir
Author-email: oz@atamir.fun
Requires-Python: >=3.11,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: aiohttp (>=3.9.3,<4.0.0)
Requires-Dist: email-validator (>=2.1.0,<3.0.0)
Requires-Dist: pydantic (>=2.6.1,<3.0.0)
Requires-Dist: urllib3 (>=2.0.0,<3.0.0)
Requires-Dist: yarl (>=1.9.4,<2.0.0)
Project-URL: Repository, https://github.com/oztamir/avoma-client
Description-Content-Type: text/markdown

# Avoma Python Client

An unofficial async Python client for the [Avoma API](https://api.avoma.com/docs).

## Installation

```bash
pip install avoma-client
```

Or with Poetry:

```bash
poetry add avoma-client
```

## Usage

```python
import asyncio
from avoma import AvomaClient
from datetime import datetime, timedelta

async def main():
    # Initialize the client with your API key
    client = AvomaClient("your-api-key")

    # Get meetings from the last 7 days
    now = datetime.utcnow()
    seven_days_ago = now - timedelta(days=7)

    meetings = await client.meetings.list(
        from_date=seven_days_ago.isoformat(),
        to_date=now.isoformat()
    )

    for meeting in meetings.results:
        print(f"Meeting: {meeting.subject} at {meeting.start_at}")

        # Get meeting insights if available
        if meeting.state == "completed":
            insights = await client.meetings.get_insights(meeting.uuid)
            print(f"Meeting insights: {insights}")

asyncio.run(main())
```

## Logging

The client includes built-in logging functionality. You can configure logging directly through the client:

```python
import logging
from avoma import AvomaClient

# Set log level directly in the client constructor
client = AvomaClient(
    api_key="your-api-key",
    log_level=logging.DEBUG,
    logger_name="my-app.avoma"  # Optional custom logger name
)
```

For more advanced logging configuration:

```python
import logging
import sys
from avoma import AvomaClient, create_logger

# Create a client with custom logging
client = AvomaClient("your-api-key", log_level=logging.DEBUG)

# Customize the logger with a specific handler if needed
handler = logging.FileHandler("avoma.log")
handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)s: %(message)s"))

# Replace default handler with custom one
for h in client.logger.handlers:
    client.logger.removeHandler(h)
client.logger.addHandler(handler)
```

The logs include:

- API request and response details (with sensitive data redacted)
- Client lifecycle events
- API call information

This is useful for debugging API interactions and understanding the client's behavior.

## Features

- Fully async API using aiohttp
- Type hints and Pydantic models for all responses
- Comprehensive test coverage
- Detailed logging for debugging
- Support for all Avoma API endpoints:
  - Meetings
  - Recordings
  - Transcriptions
  - Smart Categories
  - Templates
  - Notes
  - Meeting Sentiments
  - Users
  - Calls
  - Scorecards
  - Webhooks

## Development

1. Clone the repository
2. Install dependencies:

```bash
poetry install
```

3. Run tests:

```bash
poetry run pytest
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

MIT License

