Easy Python database interaction
Project description
easy_db
easy_db is a tool designed to quickly allow Python database interaction capabilities from a consolidated, simple user interface.
Current Features
-
DataBase class can handle both SQLite and Access file-based databases
- To "connect" to a database, use:
db = easy_db.DataBase('test_sqlite3_db.db')
- Then, retrieve table names with:
db.pull_all_table_names() - Run a "SELECT * ..." query on any table:
db.pull_full_table('TEST_TABLE')
- returned object is a list of dicts where each dict represents a row and is form {column: value}
- pull_full_table uses functools.lru_cache to limit repetative database queries
- To "connect" to a database, use:
-
For more fine-grained control of database work, the
DataBase.provide_db_connectionmethod is a decorator that can provide functions with a database connection (and cursor if specified). ```sh db = easy_db.DataBase('test_sqlite3_db.db')@db.provide_db_connection(also_cursor=True) def awesome_function(conn, cursor, x): data = cursor.execute('...SPECIAL SQL...').fetchall() conn.close() return data ```
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easy_db-0.1.0.tar.gz.
File metadata
- Download URL: easy_db-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69ad297531868d293b6017d77fd8086bc72b3cae9922cb08d94cf9ea47a785a5
|
|
| MD5 |
add74204a966d9f844cba2fdf4496061
|
|
| BLAKE2b-256 |
7869dce02146ffee87d649a8fb413e692422ba78120fc5b3dc8c77b151ee1623
|
File details
Details for the file easy_db-0.1.0-py3-none-any.whl.
File metadata
- Download URL: easy_db-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c198b4cfa309f29ac9e08116aa17459afb679222856cb9e1b44eff25c36ee34
|
|
| MD5 |
8bdddad3e563f643010eddd2ec142110
|
|
| BLAKE2b-256 |
ef469a804281355feced217def4597e9c1c02676bb23f9a4c3971cf8d1c7bb33
|