Event SMS Notifier
A Python library for event notifications with SMS capabilities using Africa's Talking API. Perfect for period tracking, appointment reminders, and general event notifications.
Installation
pip install event-sms-notifier
Quick Start
from event_notifier import EventNotifier
from datetime import datetime, timedelta
# Initialize the notifier
notifier = EventNotifier(
username="your_username", # Your Africa's Talking username
api_key="your_api_key", # Your Africa's Talking API key
sender_id="your_sender_id" # Your sender ID
)
# Add an event
notifier.add_event({
"name": "Important Meeting",
"datetime": datetime.now() + timedelta(minutes=30)
})
# Start monitoring
notifier.start_monitoring(
recipients="+1234567890", # Phone number to receive notifications
interval_seconds=120 # Check every 2 minutes
)
Features
- Event monitoring and SMS notifications
- Flexible datetime input (string or datetime object)
- Customizable message templates
- Support for multiple recipients
- Configurable check intervals
- Built-in period tracking capabilities
Period Tracking Example
from event_notifier import EventNotifier
from datetime import datetime, timedelta
notifier = EventNotifier(
username="your_username",
api_key="your_api_key",
sender_id="your_sender_id"
)
# Add period events
events = [
{
"name": "Period Starts",
"datetime": datetime.now() + timedelta(days=1)
},
{
"name": "Ovulation Day",
"datetime": datetime.now() + timedelta(days=14)
}
]
for event in events:
notifier.add_event(event)
# Custom message template
template = """
🔴 Period Alert: {name}
Time: {time}
Take care!
"""
# Start monitoring
notifier.start_monitoring(
recipients="+1234567890",
interval_seconds=300,
message_template=template
)
Requirements
- Python 3.6+
- Africa's Talking account
- Valid API credentials
- Registered phone number
Documentation
For more examples and detailed documentation, visit our GitHub repository.
License
MIT License - see LICENSE file for details.
Metadata
Release files for event-sms-notifier 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| event_sms_notifier-0.1.0.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| event_sms_notifier-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.6 kB
Release files / event_sms_notifier-0.1.0.tar.gz
| Download URL | event_sms_notifier-0.1.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
560acb7891570711d2faf4dbc7c4175655fe4d0205fdcba576a14ad6affd9e1e
|
|
BLAKE2b-256 checksum How to use checksums |
712e7eadf25f262831844d3f5ed2d5878243356a2b1d57692eb24c8447d901a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.6
|
Release files / event_sms_notifier-0.1.0-py3-none-any.whl
| Download URL | event_sms_notifier-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a7e1eb9df1a6ba3c8acaed9fd8c4cbf9d1bb1685d9c89a9d9b483f9267b201a
|
|
BLAKE2b-256 checksum How to use checksums |
2405928218eb51e7423ab89f820081c17ceaa244b9a4ea99fb49957aa34520a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.6
|