Python Package
db_conn
To use this package is necessary create file on your home ~
"~/access_information.json"
{
"database_name": {
"host": "database-db.host.net",
"user": "user",
"password": "1234",
"database": "database_name",
"port": 5432
},
}
⚠️ Warning ❗️
- Remember, if you put your
access_informationinside of your project, add this file into.gitignoreeven if it is a private project, security first 😉
After that to use in code, you just need to:
# if you do not use path var, it will assume default path as ~/access_information.json, if you want to use another path you can pass this new path
# You should pass the 'database_name' that you put on your access_information
# With path:
path = os.path.expanduser("~/access_information.json")
database_access = get_database_access(path)
db_handler = DatabaseHandler(database_access["database_name"])
###########################################################################
# You should pass the 'database_name' that you put on your access_information
# Without path
database_access = get_database_access()
db_handler = DatabaseHandler(database_access["database_name"])
To use this connection properly
query = """
select
*
from table;
"""
df = pd.DataFrame(db_handler.fetch(query))
After use, you should close connection
db_handler.close()
To create table with time series you can use code below, passing start_date, end_date, timezone and frequency
df_script_dim_table = db_handler.create_dim_date('2020-01-01', '2020-05-06', tz='utc', freq='D')
Metadata
Release files for db-conn 1.0.5
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 |
|---|---|---|---|---|
| db_conn-1.0.5.tar.gz | 4.5 kB | Without provenance | Details for db_conn-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| db_conn-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for db_conn-1.0.5-py3-none-any.whl |
Total release size: 10.3 kB
Release files / db_conn-1.0.5.tar.gz
| Download URL | db_conn-1.0.5.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e88125c1009e4d33bc0a5edf390ae95dc68507ad2bcd6ec2e38a922394e366f5
|
|
BLAKE2b-256 checksum How to use checksums |
ec7ac8556a660b37e4f5ae737128360c6ebce80d42092f280f229d0bda1ec123
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Release files / db_conn-1.0.5-py3-none-any.whl
| Download URL | db_conn-1.0.5-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4607685c6d8b49c258fc9c08898d2b7459e02b09c3fc93d36cafc91af04eb194
|
|
BLAKE2b-256 checksum How to use checksums |
a454c394524efed0b5c3d13f160494c76c2936b0d8be4710fe5218a82b2712db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Security for db-conn 1.0.5
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.