datacoco-db
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
Pyodbc Dependency Installation
Installing the Microsoft ODBC Driver for SQL Server on Linux and macOS https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15
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.
Metadata
Release files for datacoco-db 0.1.10
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 |
|---|---|---|---|---|
| datacoco-db-0.1.10.tar.gz | 16.0 kB | Without provenance | Details for datacoco-db-0.1.10.tar.gz |
Release files / datacoco-db-0.1.10.tar.gz
| Download URL | datacoco-db-0.1.10.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab845adeb31ca1838f2f66bc8076149f6766434c1a400aa78504f267efb18685
|
|
BLAKE2b-256 checksum How to use checksums |
f8bcae1d8b212c4db186265a041372cdde4e2175ea62e10fd861ee362a5f9cf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.4
|
Security for datacoco-db 0.1.10
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.