Skip to main content

A SQL/database library

Project description

master Travis CI Status PyPi package version Documentation 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 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.

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']).run()
    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.0b3.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

quma-0.1.0b3-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quma-0.1.0b3.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.2

File hashes

Hashes for quma-0.1.0b3.tar.gz
Algorithm Hash digest
SHA256 53596b12c14cc935f9c4d15f655d9990e464fca2df234ac6cb603fab3d40ece0
MD5 94feea7a2f45983d828b2026dca6d245
BLAKE2b-256 01ee6f3995f929b13d03476622f7a5222abd93b90090f2f5a54fda863f970343

See more details on using hashes here.

File details

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

File metadata

  • Download URL: quma-0.1.0b3-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.2

File hashes

Hashes for quma-0.1.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 a14186265d78009847c313b1e2075a450c4a8f3c8c12d05de2955116f0199a55
MD5 a8c7e37747b0091b7e4b2c016c3576e2
BLAKE2b-256 e3ad2a021e1abe2b83385eb596ee3b2d2d360e78a4812f8ed445e12faf649d3b

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