A Python package for supporting migration from on-prem to cloud
Project description
🚀 Snowforge - Powerful Data Integration
Snowforge is a Python package designed to streamline data integration and transfer between AWS, Snowflake, and various on-premise database systems. It provides efficient data extraction, logging, configuration management, and AWS utilities to support robust data engineering workflows.
✨ Features
- AWS Integration: Manage AWS S3 and Secrets Manager operations.
- Snowflake Connection: Establish and manage Snowflake connections with key-pair authentication.
- Advanced Logging: Centralized logging system with colored output for better visibility.
- Configuration Management: Load and manage credentials from a TOML configuration file.
- Data Mover Engine: Parallel data processing and extraction strategies for efficiency.
- Extensible Database Extraction: Uses a strategy pattern to support multiple on-prem database systems (e.g., Netezza, Oracle, PostgreSQL, etc.).
📥 Installation
Install Snowforge using pip:
pip install snowforge-package
⚙️ Configuration
Snowforge uses a snowforge_config.toml file to manage profiles and credentials for AWS and Snowflake. The package searches for this file in the following order:
- Path specified in the
SNOWFORGE_CONFIG_PATHenvironment variable. - Current working directory.
~/.config/snowforge_config.toml- Package directory.
✅ Example snowforge_config.toml
[AWS.default]
AWS_ACCESS_KEY = "your-access-key"
AWS_SECRET_KEY = "your-secret-key"
REGION = "us-east-1"
[SNOWFLAKE.default]
USERNAME = "your-username"
ACCOUNT = "your-account"
ROLE = "optional-role"
[SNOWFLAKE.svc_key_based_profile]
USERNAME = "svc_user"
ACCOUNT = "your-account"
KEY_FILE_PATH = "/absolute/path/to/your/private_key.p8"
KEY_FILE_PASSWORD = "your_key_password"
🚀 Quick Start
🔹 Initialize AWS
from Snowforge.AWSIntegration import AWSIntegration
AWSIntegration.initialize(profile="default", verbose=True)
🔹 Connect to Snowflake
from Snowforge.SnowflakeIntegration import SnowflakeIntegration
# Connect using TOML profile:
conn = SnowflakeIntegration.connect(profile="svc_key_based_profile", verbose=True)
# Or fall back to username + account only:
conn = SnowflakeIntegration.connect(user_name="your-user", account="your-account")
🔹 Use Logging
from Snowforge.Logging import Debug
Debug.log("This is an info message", level='INFO')
Debug.log("This is an error message", level='ERROR')
🔹 Extract Data Using Strategy Pattern
from Snowforge.DataMover import Engine
from Snowforge.Extractors.NetezzaExtractor import NetezzaExtractor
extractor = NetezzaExtractor()
header, output_file = Engine.export_to_file(
extractor=extractor,
output_path="/tmp/exported_data",
fully_qualified_table_name="MY_DB.MY_SCHEMA.MY_TABLE",
filter_column="date_column",
filter_value="01.01.2023",
verbose=True
)
🧩 Extending the System
Implement a new database extractor by inheriting from ExtractorStrategy and implementing:
extract_table_query(...)list_all_tables(...)export_external_table(...)
📜 License
This project is licensed under the MIT License.
👤 Author
Developed by andreasheggelund@gmail.com. Feel free to reach out for support, suggestions, or collaboration!
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file snowforge_package-0.2.11.tar.gz.
File metadata
- Download URL: snowforge_package-0.2.11.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
389ac75ab9b8e84cddb61ae5e2ac46178f05f4204d46fd8290886bb7794df4f5
|
|
| MD5 |
94b94371af79de8fbfad95ff3cb08581
|
|
| BLAKE2b-256 |
2c33fedcf73f44b9e3267cb2d29d2beda03582c1fa7bf1444a4e8e40f4e405a2
|
File details
Details for the file snowforge_package-0.2.11-py3-none-any.whl.
File metadata
- Download URL: snowforge_package-0.2.11-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0d251b995ebc3ecdaeece92b168c6dfb6dbbfac96adcfaba08b126b446ab780
|
|
| MD5 |
152b2eab25e6b4a2c7aa1c4959fe523a
|
|
| BLAKE2b-256 |
1d05c7166105ed25d2ae866b90011f37d700b4600bdc2217711735b6a104084b
|