Skip to main content

Lockally for Flask

Official Lockally extension for Flask. Send transactional email from any view with a small, idiomatic Lockally(app) extension.

Install

pip install lockally-flask

Configure

from flask import Flask
from lockally_flask import Lockally

app = Flask(__name__)
app.config["LOCKALLY_API_KEY"] = "lk_live_xxx"      # lk_test_xxx runs in sandbox
# app.config["LOCKALLY_BASE_URL"] = "https://api.lockally.com"   # optional override
lockally = Lockally(app)

The application-factory pattern is supported too:

lockally = Lockally()

def create_app():
    app = Flask(__name__)
    app.config["LOCKALLY_API_KEY"] = "lk_live_xxx"
    lockally.init_app(app)
    return app

Send

from lockally_flask import send_email

@app.post("/signup")
def signup():
    send_email(
        from_="alerts@yourdomain.com",
        to="user@example.com",
        subject="Welcome",
        text="Thanks for signing up.",
        html="<b>Thanks for signing up.</b>",
        reply_to="support@yourdomain.com",
        attachments=[("welcome.pdf", pdf_bytes, "application/pdf")],
    )
    return "", 202

send_email uses the client registered on the current app, so blueprints can call it without holding a reference. to/cc/bcc/reply_to accept a single address or a list; attachments is a list of (filename, content, content_type) (content is bytes or str).

Mapping notes

  • Reply-To is sent as a header (Lockally has no reply_to field).
  • Attachments are base64-encoded as {filename, content_type, content_base64}.
  • One Idempotency-Key is generated per send (24 h dedupe window).

License

MIT © Lockally

Metadata

Release files for lockally-flask 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lockally-flask 0.1.0
File Size Uploaded Provenance
lockally_flask-0.1.0.tar.gz 5.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lockally-flask 0.1.0
File Interpreter ABI Platform
lockally_flask-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / lockally_flask-0.1.0.tar.gz

Download URL lockally_flask-0.1.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
96cbf0147f170f20d51289a035daa98e12ac5935dc128e64fb457fa458a24a59
BLAKE2b-256 checksum
How to use checksums
b7542b832e1d0561e4fb8358c23b27219f41cb586fb34b34c0e422bfcf429262
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Release files / lockally_flask-0.1.0-py3-none-any.whl

Download URL lockally_flask-0.1.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
636852e92f2f0168ceda8af3e495308fa21f01eb72ee26f3f33425fe4341333c
BLAKE2b-256 checksum
How to use checksums
d7280a1de15d3e2d162c3cffe2cd613a13468a7c36bc1895fed38f334f17a2ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Security for lockally-flask 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lockally_flask-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page