Skip to main content

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

aldera-1.0.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aldera-1.0.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file aldera-1.0.0.tar.gz.

File metadata

  • Download URL: aldera-1.0.0.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

Hashes for aldera-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7a4d088e5a1f60e77a22b3798be031c55b6dd01f2cd639d67df8a648fcf9c824
MD5 8b7a3337e991f29860067eaf0d2503fe
BLAKE2b-256 a10652f0acea29739fa9bb263c4899722ee073d8efaf146f9d47a6a40eb98bf9

See more details on using hashes here.

File details

Details for the file aldera-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: aldera-1.0.0-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

Hashes for aldera-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dcbc3ae5affb84744e7b6d3ada9e6971b3f8529e2efacf2a22fb125235c9141c
MD5 23be8bca0ad3d4e97b45ded71291390c
BLAKE2b-256 bcec62fd897bd79ba9f160df1b6379f67a794ec388f1865a9ac2b1bad8c95316

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page