Metadata-Version: 2.4
Name: omnidapter
Version: 1.1.0
Summary: Provider-agnostic async integration library
Project-URL: Homepage, https://github.com/heckerlabs/omnidapter
Project-URL: Repository, https://github.com/heckerlabs/omnidapter/tree/main/omnidapter-core
License: MIT
Requires-Python: >=3.10
Requires-Dist: anyio>=4.0
Requires-Dist: defusedxml>=0.7
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.0
Requires-Dist: python-dateutil>=2.8.2
Provides-Extra: otel
Requires-Dist: opentelemetry-api>=1.20; extra == 'otel'
Requires-Dist: opentelemetry-sdk>=1.20; extra == 'otel'
Description-Content-Type: text/markdown

# Omnidapter Core

Provider-agnostic async calendar, booking, and CRM integration library for Python.

`omnidapter` gives you one API surface for calendars (Google, Microsoft, Zoho,
Apple, generic CalDAV), booking (Cal.com, Square, Calendly, Zoho Bookings), and
CRM (HubSpot, Pipedrive, Salesforce, Zoho CRM).

## Installation

```bash
pip install omnidapter
```

## Quick Start

### Calendar

```python
from omnidapter import Omnidapter

omni = Omnidapter(
    credential_store=my_store,
    oauth_state_store=my_state_store,
)

conn = await omni.connection("conn_123")
cal = conn.calendar()

calendars = await cal.list_calendars()

async for event in cal.list_events("primary"):
    print(event.summary)
```

### Booking

```python
from datetime import datetime, timezone
from omnidapter import Omnidapter, CreateBookingRequest, BookingCustomer

omni = Omnidapter(credential_store=my_store, oauth_state_store=my_state_store)

conn = await omni.connection("square_conn_1")
bk = conn.booking()

# Discover services and availability
services = await bk.list_services()
slots = await bk.get_availability(
    service_id=services[0].id,
    start=datetime(2026, 6, 1, tzinfo=timezone.utc),
    end=datetime(2026, 6, 7, tzinfo=timezone.utc),
)

# Book a slot
booking = await bk.create_booking(CreateBookingRequest(
    service_id=services[0].id,
    start=slots[0].start,
    customer=BookingCustomer(name="Jane Doe", email="jane@example.com"),
))
print(f"Booked: {booking.id} at {booking.start}")

# Cancel if needed
await bk.cancel_booking(booking.id)
```

## Provider Keys

### Calendar providers
- `google`
- `microsoft`
- `zoho`
- `apple`
- `caldav` (manual registration)

### Booking providers
- `calcom`
- `square`
- `calendly` (read-only — no booking creation)
- `zoho` (Zoho Bookings)

### CRM providers
- `hubspot`
- `pipedrive`
- `salesforce`
- `zoho` (Zoho CRM)

## Documentation

Normative behaviour is committed as OpenSpec capability specs in the repository
root under [`openspec/specs/`](../openspec/specs/):

- `provider-registry`, `provider-metadata` — provider setup, registration, custom providers
- `service-calendar`, `service-booking`, `service-crm` — service contracts and capabilities
- `provider-<name>` — per-provider behaviour, capability-flag values, and quirks
- `auth-credential-storage` — production credential and OAuth state storage patterns

See the repository [README](../README.md) and [ARCHITECTURE.md](../ARCHITECTURE.md) for the overview.

## Notes

- In-memory stores are for development only.
- Persist encrypted credentials for production.
- OAuth state storage must be shared across instances.
- Use `services=["booking"]` when creating a connection to scope OAuth authorization to booking only. Omit to request all services the provider supports.

## License

MIT
