A lightweight SMS and cloud utility backend for Python web applications, powered by AWS SNS.
Project description
Aldera
Aldera is a lightweight, framework-agnostic messaging toolkit providing a unified API for sending email and SMS messages. It supports both Django and Flask, and includes production-ready AWS backends using SES (email) and SNS (SMS).
Aldera is specifically designed for AWS EC2 environments using IAM instance roles. No AWS keys should be hardcoded or stored in application configuration.
Features
- Framework-agnostic: Works with Django and Flask; FastAPI support coming soon.
- AWS-powered SMS delivery via SNS.
- Simple configuration using your framework's native settings pattern.
- Minimal code changes needed to adopt across different frameworks.
- Explicit backend selection for predictable behavior.
Installation
pip install aldera
To use asynchronous functionality, add [async] qualifier:
pip install aldera[async]
Credential Philosophy
Aldera does not accept AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY settings.
Instead, Aldera relies entirely on the standard AWS credential chain, with the expectation that production deployments run on:
- EC2 instances with an IAM role
- ECS tasks with task roles
- Lambda execution roles
- Local development using AWS CLI profiles (optional)
This enforces best-practice AWS security and prevents accidental leakage of sensitive credentials.
Flask Integration
Flask SMS
from flask import Flask
from aldera.sms.flask_sms import AlderaSMS
from aldera.sms import send_sms_message
aldera = AlderaSMS()
def create_app():
app = Flask(__name__)
app.config['ALDERA_SMS_BACKEND'] = 'aws'
app.config['ALDERA_AWS_REGION'] = 'us-east-1'
aldera.init_app(app)
return app
@app.route("/test-sms")
def test_sms():
send_sms_message("Hello from Flask!", "+15555555555")
return "Message sent!"
Flask SMS config options
| Key | Description |
|---|---|
ALDERA_SMS_BACKEND |
"aws" or "locmem" |
ALDERA_AWS_REGION |
AWS region for SNS |
No API keys needed — Aldera uses the EC2 instance role.
Flask Email
from flask import Flask
from aldera.mail.flask_mail import AlderaEmail, Message
mail = AlderaEmail()
def create_app():
app = Flask(__name__)
app.config['ALDERA_AWS_REGION'] = 'us-east-1'
app.config['ALDERA_CONFIGURATION_SET'] = 'config-set'
mail.init_app(app)
return app
@app.route('/send')
def send_email():
msg = Message(
subject='Hello',
recipients=['user@example.com'],
body='This is a test email'
)
mail.send(msg)
return 'Email sent!'
Flask email config options
| Key | Description |
|---|---|
ALDERA_AWS_REGION |
AWS SES region |
ALDERA_CONFIGURATION_SET |
Optional SES config set |
Again: no AWS credentials needed.
Django Integration
Django SMS Backend
Add Aldera to your installed apps:
INSTALLED_APPS = [
...
"aldera",
]
Configure the SMS system:
ALDERA = {
'SMS_BACKEND': 'aws', # or "locmem"
'AWS_REGION': 'us-east-1',
}
Send an SMS:
from aldera.sms import send_sms_message
send_sms_message("Hello!", "+15555555555")
Credential note
No AWS keys required. Django code will automatically use the EC2 instance role.
Django Email Backend (SES)
Use Aldera's AWS SES backend:
EMAIL_BACKEND = "aldera.mail.backends.aws.AWSEmailBackend"
Configure the AWS region:
ALDERA = {
'AWS_REGION': 'us-east-1',
}
Then send email using Django’s built-in tools:
from django.core.mail import send_mail
send_mail(
"Subject",
"Body",
"from@example.com",
["to@example.com"],
)
Why No AWS Keys?
Aldera is designed to run in environments where IAM roles are the correct security mechanism. Hardcoding credentials is insecure, error-prone, and unnecessary.
Aldera follows AWS best practices by relying on:
- EC2 metadata credentials
- ECS task roles
- Lambda execution roles
- Optional AWS CLI profiles during local development
This makes migrations, deployments, and CI/CD pipelines safer and easier.
Contributing
Pull requests are welcome! If you'd like to add support for another framework or SMS backend, feel free to open an issue or PR.
License
Aldera is released under an Apache License 2.0.
Author
Zack Young
Project details
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 aldera-1.0.1.tar.gz.
File metadata
- Download URL: aldera-1.0.1.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9c52cf0da4b005352654acb17ab4ca8cd61a66b8259d3a4a49a14c93ebff656
|
|
| MD5 |
c1c9ab8062a30961ae48713baaf1fbc4
|
|
| BLAKE2b-256 |
c0808cbb0571c2f4f6ac3ae888322b713ab6d193e47282724bdb33d7fb7d07e2
|
File details
Details for the file aldera-1.0.1-py3-none-any.whl.
File metadata
- Download URL: aldera-1.0.1-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7349ae4bb6e073b92f414d41852a4a226b6874046589f5b0fc8fa518c027266d
|
|
| MD5 |
85bbdbadc8abfe9521c8b71fe385d0f7
|
|
| BLAKE2b-256 |
dec52328c6021730d7069587b056194dfac1454aac0029286536b979bc832c1d
|