Skip to main content

A SQL/database library

Project description

master Travis CI Status

quma is a small SQL database library for Python and PyPy version 3.5 and higher. It maps object methods to SQL script files and supports SQLite, PostgreSQL, MySQL and MariaDB.

Unlike ORMs it allows to write SQL as it was intented and to use all featuers the DBMS provides. As it uses plain SQL files you can fully utilize your database GUI tool.

It also provides a simple connection pool.

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'])
    cur.commit()

    admin = cur.get_admin()

License

quma is released under the MIT license.

Copyright © 2018 ebene fünf GmbH. All rights reserved.

Project details


Download files

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

Source Distribution

quma-0.1.0a2.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

quma-0.1.0a2-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file quma-0.1.0a2.tar.gz.

File metadata

  • Download URL: quma-0.1.0a2.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.4+

File hashes

Hashes for quma-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 1958368814d824ca87c773b50361216e9c767b10b9d85c909323f12f920bdec0
MD5 ebce0eeb8b4e6c92f4da22afc7ea8562
BLAKE2b-256 4f14b4a0e8454d1f9bf31623f31c5ba453e72cfaa5986d63c99d8766f42a4fa2

See more details on using hashes here.

File details

Details for the file quma-0.1.0a2-py3-none-any.whl.

File metadata

  • Download URL: quma-0.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.4+

File hashes

Hashes for quma-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f2e7bd6f06f68580beaa0b5611e01a3d1515edf1f628cebe182e47a782f65f5
MD5 13791d2931b5fbd538fa01221555364e
BLAKE2b-256 3b1b519d1572e466edb7aa17ac571f22f86014afd2fa4f3895d7799d996a481c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page