A library for event notifications with SMS capabilities using Africa's Talking
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file event_sms_notifier-0.1.0.tar.gz.
File metadata
- Download URL: event_sms_notifier-0.1.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
560acb7891570711d2faf4dbc7c4175655fe4d0205fdcba576a14ad6affd9e1e
|
|
| MD5 |
c389cf5b25edfb42ddb102022111bdb3
|
|
| BLAKE2b-256 |
712e7eadf25f262831844d3f5ed2d5878243356a2b1d57692eb24c8447d901a4
|
File details
Details for the file event_sms_notifier-0.1.0-py3-none-any.whl.
File metadata
- Download URL: event_sms_notifier-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a7e1eb9df1a6ba3c8acaed9fd8c4cbf9d1bb1685d9c89a9d9b483f9267b201a
|
|
| MD5 |
e4f53a3f412bfdf4f7ca435f661ec308
|
|
| BLAKE2b-256 |
2405928218eb51e7423ab89f820081c17ceaa244b9a4ea99fb49957aa34520a7
|