Skip to main content

quma

PyPi package version Documentation Status

quma is a small SQL database library for Python 3.11 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('sqlite3:///: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.4.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 quma 0.4.0
File Size Uploaded Provenance Actions
quma-0.4.0.tar.gz 55.8 kB Without provenance Details for quma-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quma 0.4.0
File Interpreter ABI Platform Actions
quma-0.4.0-py3-none-any.whl Python 3 none any Details for quma-0.4.0-py3-none-any.whl

Total release size: 107.0 kB

Release files / quma-0.4.0.tar.gz

Download URL quma-0.4.0.tar.gz
Size 55.8 kB
Tags Source
SHA-256 checksum
How to use checksums
76c4d13077a245fa6785036e66dee19a8e1fcbd4cb528402a64ccf7419b3d15f
BLAKE2b-256 checksum
How to use checksums
dd580e67011126f2e99f1074d8231bea687b5aac62fa287697d04f42fefa4359
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / quma-0.4.0-py3-none-any.whl

Download URL quma-0.4.0-py3-none-any.whl
Size 51.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77bca95c5c33faa1f70506280e1b557b279227040ac737b7892385c486f7809f
BLAKE2b-256 checksum
How to use checksums
efba86b4ffb12b418e4997711cc229a6f0425f4346a5d48abe4093bb0aa90e1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for quma 0.4.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.

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.

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