Skip to main content

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 effortlessly.
  • 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 requires a configuration file (snowforge_config.toml) to manage credentials for AWS and Snowflake. The package searches for the config file in the following locations:

  1. Path specified in SNOWFORGE_CONFIG_PATH environment variable.
  2. Current working directory.
  3. ~/.config/snowforge_config.toml
  4. Package directory.

Example snowforge_config.toml File

[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"

🚀 Quick Start

🔹 Initialize AWS Integration

from Snowforge.AWSIntegration import AWSIntegration

AWSIntegration.initialize(profile="default", verbose=True)

🔹 Connect to Snowflake

from Snowforge.SnowflakeConnect import SnowflakeConnection

conn = SnowflakeConnection.establish_connection(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 from an On-Prem Database

import Snowforge.AWSIntegration as aws

def export_and_upload_table_data(extractor: ExtractorStrategy):

    #Fetch data from an on-prem system:
    query = extractor.extract_table_query("database.schema.table", "filter_column", "filter_value")
    full_path_to_file = extractor.export_table_to_file(query, output_path, file_format(optional))

    aws.upload_to_s3("bucket name", full_path_to_file, "key to store the file under in S3")

def main():
    from Snowforge.Extractors.NetezzaExtractor import NetezzaExtractor
    from Snowforge.Extractors.OracleExtractor import OracleExtractor
    from Snowforge.Extractors.PostgrSQLExtractor import PostgrSQLExtractor

    # Export and upload data from different source systems by exchanging the extractor strategy
    export_and_upload_table_data(NetezzaExtractor())
    export_and_upload_table_data(OracleExtractor())
    export_and_upload_table_data(PostgrSQLExtractor())

Since Snowforge follows a strategy pattern, it can be easily extended to support other database systems by implementing new extractor classes that conform to the ExtractorStrategy interface.


📜 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


Download files

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

Source Distribution

snowforge_package-0.2.8.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snowforge_package-0.2.8-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file snowforge_package-0.2.8.tar.gz.

File metadata

  • Download URL: snowforge_package-0.2.8.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for snowforge_package-0.2.8.tar.gz
Algorithm Hash digest
SHA256 be9d2e8a6e46ccb03a17bb54c2be240a00f3d15731036393df363c1d8ad5c02f
MD5 c4dcb073f0286f4cb39f95dd06c678db
BLAKE2b-256 5ddef07ecd8c695f64c40ca2e0f80a1c76d018ec5ac6be83564a24afa38a82b8

See more details on using hashes here.

File details

Details for the file snowforge_package-0.2.8-py3-none-any.whl.

File metadata

File hashes

Hashes for snowforge_package-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 78425933521c67a3911cdfca581aad357abb0190d684c2e6d822b57c3c7886bf
MD5 40862116b471cd57da09a202c4424003
BLAKE2b-256 1c8452ce4275d7647e0ab7097b44072d5aeb6767e7e8f8930e8dcd6be1f73cf4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page