A package for database session management
Project description
Data Warehouse Connector
A Python module to establish connections to various data warehouses like Snowflake, Redshift, and PostgreSQL.
Overview
This README.md
file provides comprehensive instructions for installing, setting up, and using the Data Warehouse Connector
module, ensuring users can easily establish connections to their data warehouses.
Data Warehouses
Snowflake
Requires DB_SOURCE
, USERNAME
, HOST
, PASSWORD
, ROLE
, WAREHOUSE
, and DATABASE
.
from datawarehouse_connector.connector import get_session
snowflake_creds = {
"db_source": "snowflake",
"user": "user",
"password": "password",
"role": "role",
"warehouse": "warehouse",
"database": "database",
"host": "host",
}
session = get_session(snowflake_creds)
session.close()
Redshift
Requires DB_SOURCE
, USERNAME
, HOST
, PASSWORD
, and DATABASE
.
from datawarehouse_connector.connector import get_session
redshift_creds = {
"db_source": "redshift",
"user": "user",
"password": "password",
"database": "database",
"host": "host",
}
session = get_session(redshift_creds)
session.close()
PostgreSQL
Requires DB_SOURCE
, USERNAME
, HOST
, PASSWORD
, and DATABASE
.
from datawarehouse_connector.connector import get_session
postgresql_creds = {
"db_source": "postgresql",
"user": "user",
"password": "password",
"database": "database",
"host": "host",
}
session = get_session(postgresql_creds)
session.close()
Handling Connection
Once the session is established, you can interact with your data warehouse using SQLAlchemy's ORM capabilities.
Troubleshooting
Common Issues
- Invalid Credentials: Ensure that the USERNAME and PASSWORD are correct.
- Host Unreachable: Verify the HOST address and network connectivity.
- Unsupported Data Source: Check if the DB_SOURCE is among the supported ones (snowflake, redshift, postgresql).
Error Handling
The get_session
method prints exceptions to help identify issues during the connection process. Ensure that the provided connection details are accurate and the data warehouse is accessible.
Conclusion
This module simplifies the process of connecting to various data warehouses. Follow the setup instructions carefully, and refer to the examples for guidance on using the get_session
function. For further assistance, check the documentation or raise an issue on the project's GitHub repository.
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
Built Distribution
File details
Details for the file datawarehouse_connector-0.1.2.tar.gz
.
File metadata
- Download URL: datawarehouse_connector-0.1.2.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dd9bc0ca1eea2b1cfa1a0c9ff6145b9998b7d30c137a6af0d7cdfb9ba88fc3b |
|
MD5 | 64c17aa52dd4c4f3ca3a273cdf5ea86f |
|
BLAKE2b-256 | e1457d61d0faed84f4bc7fa505abf5ac55cab615f78153dda122638df910929f |
File details
Details for the file datawarehouse_connector-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: datawarehouse_connector-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4add06ba158d956c78cf085730d3a40262add9d0f6e5b20c2064db1acba6af68 |
|
MD5 | 3f3c9762e62ab194b8f9f438a803d76c |
|
BLAKE2b-256 | 4adb5be3b531ce372d5804cf5fa895f50d26d9600fb739bf0c88e2c6644f32e1 |