Skip to main content

common code for DBs

Project description

https://api.codacy.com/project/badge/Grade/4d85afc6c49f40eab14f9aa60336ac64 https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datacoco-db-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

File details

Details for the file datacoco-db-0.1.0.tar.gz.

File metadata

  • Download URL: datacoco-db-0.1.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for datacoco-db-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1a8480d57b9af23c9ce562ca134d781928196c64b77ba8a2e24b9e909951b5e3
MD5 c73c1dccdd2986d0f35d16a0f0d6b57b
BLAKE2b-256 1f6b80f58caadab66a9cdb534c9207b07e3322b7130e46f2d0da5830ddde953d

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