Skip to main content

ashurbanipal (flask-python)

A Flask port of Ashurbanipal — implements the same spec/protocol.md + spec/openapi.yaml contract as the Rust reference and the Kotlin/Spring Boot, Go/net-http, and Node/Express ports. Ships three backends from day one: Postgres (psycopg), SQLite (stdlib sqlite3), and MySQL/MariaDB (PyMySQL) — see ashurbanipal/db/.

uv add ashurbanipal-flask       # or: pip install ashurbanipal-flask

Usage

from flask import Flask
from ashurbanipal import Config, router
from ashurbanipal.db.postgres import PgSource

# raises ProductionEnabledError for a production-like value
config = Config(environment="dev", enabled_for=["dev"])
source = PgSource(dsn=os.environ["DATABASE_URL"])

app = Flask(__name__)
app.register_blueprint(router(config, source))

Config() (the zero-argument default) is disabled by construction: enabled_for is empty, so is_enabled() is False regardless of environment — a host that forgets to configure anything gets a 404'd viewer, never one silently enabled with defaults.

Every backend opens one fresh physical connection per operation (no pool) — this trivially satisfies spec/protocol.md §1's "resolve the schema once per operation" invariant without the explicit transaction-pinning a pooled driver (Rust's sqlx::Pool) needs. A host wanting connection pooling wraps the driver call inside its own DbSource implementation.

Database support

Same per-backend degraded features and mechanisms as the Rust reference (comments/common-values unavailable on SQLite and MySQL, MySQL-vs-MariaDB runtime detection for the query-timeout mechanism) — see docs/adapter-decisions.md for the full registry. SqliteSource needs a real file path, not :memory:: SQLite's in-memory database is private per-connection, and this backend reconnects on every operation, so :memory: would be empty again on the next call.

ASHURBANIPAL_BACKEND=sqlite ASHURBANIPAL_SQLITE_PATH=./demo.db uv run python demo/app.py
ASHURBANIPAL_BACKEND=mysql MYSQL_TEST_URL=mysql://root:pw@host:3306/db uv run python demo/app.py

Full API/config reference: docs/design.md.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ashurbanipal_flask-0.1.1.tar.gz (47.4 kB view details)

Uploaded Source

Built Distribution

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

ashurbanipal_flask-0.1.1-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file ashurbanipal_flask-0.1.1.tar.gz.

File metadata

  • Download URL: ashurbanipal_flask-0.1.1.tar.gz
  • Upload date:
  • Size: 47.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ashurbanipal_flask-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7c0c51fb667cffd8b4ef1c8794d9ca408949de0ce3c7abadedb345dfe1ae4771
MD5 ac5541e44369aea9de25cecd4d3c14ce
BLAKE2b-256 fd43b18b6f9807b884a1dac6fa06550c483c712f71acb5cdedac90f3dc16745b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ashurbanipal_flask-0.1.1.tar.gz:

Publisher: flask-python-publish.yml on mt-empty/ashurbanipal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ashurbanipal_flask-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ashurbanipal_flask-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd58252623ccb59d8f3b15b91b5d1faae43e890e3c119328745e178badc79315
MD5 f1ea3ab7162c07cd9ca138af95c4baf5
BLAKE2b-256 275c32ee4e3922fedc59a4fa0e7d50733a407868a06c147ab56606ddd21cc3f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for ashurbanipal_flask-0.1.1-py3-none-any.whl:

Publisher: flask-python-publish.yml on mt-empty/ashurbanipal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

This release

0.1.1 This release

2 files

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