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.7.tar.gz (12.7 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.7-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for snowforge_package-0.2.7.tar.gz
Algorithm Hash digest
SHA256 5e97240c334e4304e3358b64dd92cce30ef37cd211c85acf84116c8285350925
MD5 1dfc1680538d3c135aaf372c1312587c
BLAKE2b-256 fa407ddd0d30fa5134ec7cfc252e5782eabdb5318a27cf81696921965bc7ed26

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for snowforge_package-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 848cb2f9263037d253480456cfa5de031aa5724cea9c8a9e5873853cfd155959
MD5 2c5c742c63eb6b40b9c18d202e908863
BLAKE2b-256 546ebc777257626c293ef271d63d3e1a9eb0a281649a1247c7a6e69449b9342e

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