Skip to main content

This package contains utility functions for Prefect and Snowflake

Project description

orchestration-utilities

This repository holds the utilities modules that are essential for ETL operations. This repository will be used as a package and serve the ETL flows.
This package will be used in the PREFECT flows and SNOWFLAKE as part of the ETL operations.

Installation

Install the package using PYPI

pip install orchestration-utils

Inside this package

1. aws.py

This module contains the functions that are used to interact with the AWS services.
Example: S3


2. etl_contol.py

This module contains the functions that interact with Snowflake and stores the states of the flows in the database.

  • This module accepts the connection(connection_creds) paramater where the default value is snowflake-prefect-user, pipeline name and environment name.
  • The pipeline name and environment name are used to store the states of the flows in the database. Example when the flow is started, completed, failed, etc.

3. etl_operations.py

This module contains the functions that are used to perform the ETL operations either in the Destination table or in the Source table.

Class/Groups:

  • CreateConnections: This class is used to create the connections to the databases. The connections are created using the connection credentials and warehouse name.
  • SnowflakeDestination: This class contains all the load types and the functions that are used to load the data into the Snowflake tables.
    This class accepts the connection credentials (by default the value is snowflake-prefect-user), warehouse name(by default the value is loading), database name, and environment name(by default the value is dev).
  • DataFrameHadler: This class contains the functions that converts the dataframes columns to the relevant data types.
  • SchemaDriftHandler: This class contains the functions that are used to handle the schema drifts in the destination table.
  • SnowflakeSource: This class contains the functions that are used to extract the data from the Snowflake tables.

4. notifications.py

This module contains the functions that are used to send the notifications to Slack. The Webhook blocks need to be created in Prefect first to send the notifications to Slack.

Class/Groups:

  • SlackWebhooksNotification: This class is used to send the notifications to Slack. The Class accepts the webhook name and the message that needs to be sent to Slack.

5. queries.py

This module contains the queries that are used to perform the ETL operations in the Snowflake tables. This module is referred by the etl_control and etl_operations modules.

How to locally build package

Install the dependencies in your virtual environment.

pip install -r requirements-dev.txt

Build dist floder where .whl and .tar.gz files are created

make build

This will create the dist folder where two files are created.

  • orchestration_utils-0.0.0.tar.gz
  • orchestration_utils-0.0.0-py3-none-any.whl

The .whl is the installation file that can be installed using the pip install dist/orchestration_utils-0.0.0-py3-none-any.whl command.

How to deploy

Deploy the package to the PYPI using Github Actions. There are two workflows one to deploy in dev and the other to deploy in production.

1. Dev/Manual Release to TestPyPI

  • Click on Run workflow
  • Select the branch that you have made the changes
  • The changes will be refelcted in TestPyPI

2. Prod Release to PyPI

  • Click on Run workflow
  • Select the main branch only
  • The changes will be refelcted in PyPI

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

orchestration_utils-0.0.5.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

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

orchestration_utils-0.0.5-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file orchestration_utils-0.0.5.tar.gz.

File metadata

  • Download URL: orchestration_utils-0.0.5.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for orchestration_utils-0.0.5.tar.gz
Algorithm Hash digest
SHA256 0207bbbf6a8aec4d18247fe1b2b68f17e5581cb63f3352d4393467339e1141fa
MD5 310d0898b1fd47fb8b8bc95e3603ff5e
BLAKE2b-256 18c4624bd2454b94687b08ca4f3851e3584b07d7d29418e4f0f12adbe2dcfc21

See more details on using hashes here.

Provenance

The following attestation bundles were made for orchestration_utils-0.0.5.tar.gz:

Publisher: prod-release.yml on cloudfactory/orchestration-utilities

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file orchestration_utils-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for orchestration_utils-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 870ac7db10e5c13130d324864eaecbb9733210373f56cef7091aef9e27e59120
MD5 45c269c24420fc72b31ab0b6084a7fc7
BLAKE2b-256 b94989373bf2ab566d1fef039b768f05b41fc844a1da42f8c271c497f9cc4626

See more details on using hashes here.

Provenance

The following attestation bundles were made for orchestration_utils-0.0.5-py3-none-any.whl:

Publisher: prod-release.yml on cloudfactory/orchestration-utilities

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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