A SQL/database library
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file quma-0.1.0a1.tar.gz
.
File metadata
- Download URL: quma-0.1.0a1.tar.gz
- Upload date:
- Size: 18.3 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bbe7cd040192630ccd367a82598bbde863bd45dd951954ef21a0775f4e9c30c |
|
MD5 | 07fbcbfb307dde0e5050b139735369da |
|
BLAKE2b-256 | 4abb02d9f7e66802c65c8811a73bf875f0f481e3824b8f831ef64bcab1f13375 |
File details
Details for the file quma-0.1.0a1-py3-none-any.whl
.
File metadata
- Download URL: quma-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 24.1 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 942cba7d670f14da68d901d9ee9ad65f95e73290a414600e9cd08e6f90fe02c1 |
|
MD5 | 931791d8fbd3ed6a7ca1dd1e143a2fbe |
|
BLAKE2b-256 | 4284600b246ba41fb8efc05ba2be50b4583c1b5d7b717c7ea0b2e9b3db822765 |