common code for DBs
Project description
Equinox Common Code Utility for Python 3 for DB interactions! There are currently interaction classes for the following DBs and Apps:
MSSQL
MySQL
SQLite
Postgres
Redshift
Quick Start
Sample Usage
from datacoco_db import MSSQLInteraction mssql = MSSQLInteraction(dbname="db_name", host="server", user="user", password="password", port=1433) mssql.conn() # open a connection mssql.batch_open() # cursor results = mssql.fetch_sql_one("SELECT * FROM MyTable") # fetch one print(results) mssql.batch_close() # close cursor
The example above makes use of mssql_tools. All tools follows the same pattern in terms of usage.
Installation
datacoco-db requires Python 3.6+
python3 -m venv <virtual env name> source <virtual env name>/bin/activate pip install datacoco-db
Development
Getting Started
It is recommended to use the steps below to set up a virtual environment for development:
python3 -m venv <virtual env name> source <virtual env name>/bin/activate pip install -r requirements.txt
Testing
pip install -r requirements-dev.txt
Modify the connection configuration for integration testing.
To run the testing suite, simply run the command: python -m unittest discover tests
For coverage report, run tox View the results in .tox/coverage/index.html
Contributing
Contributions to datacoco_db are welcome!
Please reference guidelines to help with setting up your development environment here.
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
File details
Details for the file datacoco-db-0.1.3.tar.gz
.
File metadata
- Download URL: datacoco-db-0.1.3.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 324b61c81bbb1d88809d649c738f014fc44dd6d2feaa622aec456138c633eb47 |
|
MD5 | 9e47f490b03ee4e830e325989cd55e79 |
|
BLAKE2b-256 | 55af70f4cf25c4d851fa7d669d607e367041fe91f64b9bc10a578b93577289a0 |