DBCW
DBCW (Database Connection Wrapper) is a python package that allows you to connect to different types of databases and contains methods for getting the necessary data.
This is a good choice for you if you do not want to deal with queries to the database and you just need basic functionality for getting data.
But if you need to send your own query to the database - this is also possible.
Supported engines:
- PostgreSQL
- MySQL / MariaDB
Documentation
You can run the pydoc module to read the documentation:
python -m pydoc -b
Installation
Use the package manager pip to install dbcw.
pip install dbcw
Usage
Import:
from dbcw import DBConnectionWrapper
PostgreSQL connection
connection = DBConnectionWrapper(
host='localhost', user='root', password='1234')
MySQL connection
connection = DBConnectionWrapper(
engine='mysql', host='localhost', user='root', password='1234')
Get database list
>>> connection.get_db_list()
['db1', 'db2'] # output example
Get tables list from the database
>>> connection.get_tables_list('db_name')
[('friends', 'numbers')] # output example
Get table data
connection.get_table_data('db_name', 'table_name')
Get database structure (depends on engine)
connection.get_db_structure('db_name')
Get table structure (depends on engine)
connection.get_table_structure('db_name', 'table_name')
Execute custom query
connection.execute_query('SELECT * FROM table;')
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
Metadata
Release files for dbcw 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dbcw-0.2.3.tar.gz | 4.6 kB | Without provenance | Details for dbcw-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dbcw-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for dbcw-0.2.3-py3-none-any.whl |
Total release size: 13.0 kB
Release files / dbcw-0.2.3.tar.gz
| Download URL | dbcw-0.2.3.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e49b42c67a67fc2ecc9e3577f8e4a3992388f98c21f6f58c880b7baf69e81bb
|
|
BLAKE2b-256 checksum How to use checksums |
d458bc8ca6f56918230e2f0492e9c258b3be58667cf32c87ec572c3788d475e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Release files / dbcw-0.2.3-py3-none-any.whl
| Download URL | dbcw-0.2.3-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b47d50dfa520866bcd78972e86809dc4e50f80e6c8f5e8297ff88d90318ecaec
|
|
BLAKE2b-256 checksum How to use checksums |
148924992caa3ce316fa745c9271a2f585dd689b855f0cb00be9f1c35cf8b307
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Security for dbcw 0.2.3
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.