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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c0c51fb667cffd8b4ef1c8794d9ca408949de0ce3c7abadedb345dfe1ae4771
|
|
| MD5 |
ac5541e44369aea9de25cecd4d3c14ce
|
|
| BLAKE2b-256 |
fd43b18b6f9807b884a1dac6fa06550c483c712f71acb5cdedac90f3dc16745b
|
Provenance
The following attestation bundles were made for ashurbanipal_flask-0.1.1.tar.gz:
Publisher:
flask-python-publish.yml on mt-empty/ashurbanipal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ashurbanipal_flask-0.1.1.tar.gz -
Subject digest:
7c0c51fb667cffd8b4ef1c8794d9ca408949de0ce3c7abadedb345dfe1ae4771 - Sigstore transparency entry: 2487227724
- Sigstore integration time:
-
Permalink:
mt-empty/ashurbanipal@a8748ebe0d8a8e9c9b667f35b67fbdb803283849 -
Branch / Tag:
refs/tags/flask-v0.1.1 - Owner: https://github.com/mt-empty
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
flask-python-publish.yml@a8748ebe0d8a8e9c9b667f35b67fbdb803283849 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ashurbanipal_flask-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ashurbanipal_flask-0.1.1-py3-none-any.whl
- Upload date:
- Size: 26.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd58252623ccb59d8f3b15b91b5d1faae43e890e3c119328745e178badc79315
|
|
| MD5 |
f1ea3ab7162c07cd9ca138af95c4baf5
|
|
| BLAKE2b-256 |
275c32ee4e3922fedc59a4fa0e7d50733a407868a06c147ab56606ddd21cc3f9
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ashurbanipal_flask-0.1.1-py3-none-any.whl -
Subject digest:
dd58252623ccb59d8f3b15b91b5d1faae43e890e3c119328745e178badc79315 - Sigstore transparency entry: 2487228255
- Sigstore integration time:
-
Permalink:
mt-empty/ashurbanipal@a8748ebe0d8a8e9c9b667f35b67fbdb803283849 -
Branch / Tag:
refs/tags/flask-v0.1.1 - Owner: https://github.com/mt-empty
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
flask-python-publish.yml@a8748ebe0d8a8e9c9b667f35b67fbdb803283849 -
Trigger Event:
push
-
Statement type: