quma
quma is a small SQL database library for Python and PyPy version 3.10 and higher. It maps object methods to SQL script files and supports SQLite, PostgreSQL, MySQL and MariaDB.
It also provides a simple connection pool and templating for dynamic SQL like conditional WHEREs.
Motivation
Unlike ORMs, it allows to write SQL as it was intended and to use all features the DBMS provides. As it uses plain SQL files you can fully utilize your database editor or IDE to author your queries.
If you know how to best design your DDL and already have a SELECT in your mind when data needs to be retrieved, welcome, this is for you.
It gives you back your powers you so carelessly gave away to ORMs.
Installation
pip install quma
Quick Start
The full documentation is available at https://quma.readthedocs.io
Given a directory with some SQL scripts e. g.:
/path/to/sql/scripts ├── users │ ├── all.sql │ └── remove.sql └── get_admin.sql
You can access these scripts after connecting to the database:
from quma import Database
db = Database('sqlite:///:memory:', '/path/to/sql/scripts')
db.execute('CREATE TABLE users ...')
with db.cursor as cur:
all_users = cur.users.all()
for user in all_users:
print(user['name'])
cur.users.remove(id=user['id']).run()
cur.commit()
admin = cur.get_admin().one()
License
quma is released under the MIT license.
Copyright © 2018-present ebene fünf GmbH. All rights reserved.
Metadata
Release files for quma 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| quma-0.2.2.tar.gz | 43.4 kB | Without provenance | Details for quma-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quma-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for quma-0.2.2-py3-none-any.whl |
Total release size: 83.3 kB
Release files / quma-0.2.2.tar.gz
| Download URL | quma-0.2.2.tar.gz |
|---|---|
| Size | 43.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1e28fc6acf22c237797692b6dbf02323e19bac8f2cb34b76db2bd317236c0b2
|
|
BLAKE2b-256 checksum How to use checksums |
34e3c5957d1bc858784bf6cf182bfa321bbd9325057e83fcaa6dc14b87192bec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / quma-0.2.2-py3-none-any.whl
| Download URL | quma-0.2.2-py3-none-any.whl |
|---|---|
| Size | 40.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dbb94186dde8a59001d83e0b0346583040e06b6c92b0f32c306bdedd29fb6b74
|
|
BLAKE2b-256 checksum How to use checksums |
3cd102990a8081f552fb20905e44d8cad83834d0d61db2242e621d64517df4b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for quma 0.2.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.