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.3.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.3.0
File Size Uploaded Provenance Actions
quma-0.3.0.tar.gz 49.5 kB Without provenance Details for quma-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 96.1 kB

Release files / quma-0.3.0.tar.gz

Download URL quma-0.3.0.tar.gz
Size 49.5 kB
Tags Source
SHA-256 checksum
How to use checksums
755129c46f4b157204782f0de87ec7f31efe6f0fea19c802c8cbcf54c50cc443
BLAKE2b-256 checksum
How to use checksums
5cf538135ad74ec32689bba7fbfc685fe2591ee6b95abc7c82d22248d8875f60
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.3.0-py3-none-any.whl

Download URL quma-0.3.0-py3-none-any.whl
Size 46.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d6c81966bc27d7dd80cac31a2d49dbb6ee7962177f2e0bcdfb17b25d08a4a9e
BLAKE2b-256 checksum
How to use checksums
65f7a9e9a1aeebfd50bc275931c1fa246687fe9dc6699f61920da3a4412b5c28
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.3.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