Metadata-Version: 2.4
Name: tako_alerts_system
Version: 0.2.10
Summary: Read PyPI package information
Home-page: https://github.com/melius/itsTako_alerts_library
Author: Gabriel González
Author-email: gabriel.gonzalez@meliusid.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-python
Dynamic: summary

# itsTako_alerts_library

refer to Melius I+D

## Speed alert driver notifications

Driver lookup and Telegram delivery are opt-in. Pass `driver_notification_config`
to `SpeedAlerts` to enable them; omit it to retain the existing synchronous
WhatsApp flow.

```python
SpeedAlerts(
    redis_client=redis_client,
    whatsapp_config=whatsapp_config,
    time_window=60,
    alert_threshold=2,
    driver_notification_config={
        "api_key": os.getenv("TAKO_API_KEY"),
        "telegram_bot_token": os.getenv("TELEGRAM_TOKEN_EMASIVO"),
        "max_workers": 2,
        "request_timeout": 5,
    },
)
```

The trips API URL defaults to the Emasivo external trips endpoint and can be
overridden with `trips_api_url`. The API key is sent as `x-api-key`. Bus IDs
matching `ZXX2222` are normalized to `ZXX-2222` for lookup only. Background
workers perform driver lookup, WhatsApp/Telegram delivery, reverse geocoding,
and alert persistence without blocking the queue consumer.

Telegram messages include the alert bus and local time. When valid coordinates
are available, they also include a **Ver ubicación** button that opens the
alert location in Google Maps.
