Snowpack Data's internal AI automations for simple, robust, and highly automated Data stack deployments
Project description
Snowpack Stack
snowpack_stack is Snowpack Data's internal AI-enhanced automations for comprehensive, robust, and highly automated Data stack deployments.
Installation Guide
Prerequisites
- Python 3.11 or higher
Simple Installation
Install Snowpack Stack directly with pip:
pip install snowpack_stack
That's it! Snowpack Stack is now installed and ready to use.
Verifying Installation
You can verify your installation by running:
snowpack setup verify
Setting User Information (Optional)
You can optionally set your email for identification and usage tracking:
snowpack setup auth --email your.email@example.com
Basic Usage Example
After installing, you can start using Snowpack Stack to generate assets:
import snowpack_stack
# Optional: set your email for identification
# snowpack_stack.set_user_email("your.email@example.com")
# Generate YAML assets for database tables
yaml_results = snowpack_stack.generate_yaml_assets()
print(f"Generated {len(yaml_results)} YAML assets")
# Generate SQL transformation assets
sql_results = snowpack_stack.generate_sql_assets()
print(f"Generated {len(sql_results)} SQL assets")
# Or run all generators at once
all_results = snowpack_stack.run_all()
print(f"Generated {len(all_results)} total assets")
Command-Line Interface
Snowpack Stack provides a CLI for building assets and setting up the environment.
Public Commands
The following commands are available to all users:
Build Commands
Build commands are used to generate assets:
# Build all assets
snowpack build
# Build only Bruin assets
snowpack build bruin
# Build only Bruin YAML assets
snowpack build bruin yaml
# Build only Bruin SQL assets
snowpack build bruin sql
Setup Commands
Setup commands are used to configure the environment:
# Run the complete setup process (optional)
snowpack setup
# Set your email for identification (optional)
snowpack setup auth --email your.email@example.com
# Run verification to check installation
snowpack setup verify
# Verify internal developer access
snowpack setup verify-internal
Output Files
The system generates files in the following location:
{parent_directory}/bruin-pipeline/assets/
Where {parent_directory} is typically the parent of the snowpack_stack_product directory.
YAML Asset Files
YAML asset files (raw_{table}.asset.yml) are generated for each source table. These files contain:
- Table metadata (name, owner, description)
- Ingestion settings (source connection, source table)
- Column definitions with data types
- Primary key and constraint information
SQL Asset Files
SQL transformation files ({table}.sql) are generated for each source table. These files contain:
- A YAML metadata block inside
@bruintags - A SQL query that selects from the raw table
- Filtering to exclude deleted records
High-Level Architecture
Snowpack Stack follows a modular, layered approach:
- Core Layer: Handles configuration loading, validation, and common utilities
- Generator Layer: Contains the implementation logic for creating different asset types
- CLI Layer: Provides command-line interfaces for executing generators
- Authentication Layer: Manages email-based authorization for package usage
- Utilities: Common tools for database connections, logging, etc.
Key Features
1. YAML Asset Generation
- Generates Bruin-compatible YAML asset files for raw tables
- Supports automatic schema and table discovery
- Configures proper data types and column metadata
2. SQL Asset Generation
- Creates Bruin-compatible SQL transformation files
- Implements the
@bruinmetadata block format - Generates simple SQL queries for cleaned data access
3. Environment Management
- Supports environment variables for secure credential management
- Flexible configuration with parent directory discovery
- Symbolic link support for shared environment files
Authentication
Snowpack Stack uses basic authentication for identifying users:
User Authentication
The easiest way to set up authentication is with the built-in verification command:
snowpack setup verify
This command will guide you through the authentication process and verify your installation.
You can also use the dedicated authentication command:
snowpack setup auth --email your.email@example.com
Troubleshooting
Common Issues
-
Authentication Failures:
- Check if your email is valid
- Ensure you've called
set_user_email()before using generators - Check if the environment variable
SNOWPACK_USER_EMAILis set correctly
-
Environment Variables Not Found:
- Ensure your
.envfile is in the correct location - Check if there are multiple
.envfiles causing conflicts - For parent directory setup, verify the symbolic link exists
- Ensure your
-
Database Connection Issues:
- Verify database credentials in your
.envfile - Check network connectivity to the database server
- Ensure the database server is running
- Verify database credentials in your
-
Output Files Not Generated:
- Check the log output for errors
- Verify the
bruin-pipeline/assetsdirectory exists in the parent directory - Ensure the user running the command has write permissions
Internal Features
Some advanced features of Snowpack Stack, such as release management, are restricted to Snowpack developers. If you need access to these features, please contact the Snowpack team.
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
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 snowpack_stack-0.4.11.tar.gz.
File metadata
- Download URL: snowpack_stack-0.4.11.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7db3934d51b6896a8058d21e738e76da044cb0663167b4fdcec5ddc34bc749c
|
|
| MD5 |
cc22e94474765b57fd1feddfee823b57
|
|
| BLAKE2b-256 |
a054f3efd78c570fe5fde4d15554a35a2a5e30939f4b5cfc81a86f65c286c28f
|
Provenance
The following attestation bundles were made for snowpack_stack-0.4.11.tar.gz:
Publisher:
pypi-publish.yml on snowpackdata/snowpack_stack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snowpack_stack-0.4.11.tar.gz -
Subject digest:
e7db3934d51b6896a8058d21e738e76da044cb0663167b4fdcec5ddc34bc749c - Sigstore transparency entry: 181840993
- Sigstore integration time:
-
Permalink:
snowpackdata/snowpack_stack@299dcdef586bec3613c248f7e59092f2f9e9a3e5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/snowpackdata
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@299dcdef586bec3613c248f7e59092f2f9e9a3e5 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file snowpack_stack-0.4.11-py3-none-any.whl.
File metadata
- Download URL: snowpack_stack-0.4.11-py3-none-any.whl
- Upload date:
- Size: 51.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
354fb8378b0658c161227097d523d6a65d883eff8b4f01e9ad7051957c4631e0
|
|
| MD5 |
03ae3ca39a015828d94b7070c544bb24
|
|
| BLAKE2b-256 |
e3a60d7b7a97bd87ecaf48463bd6dd5515fd5d89d59525601b78cc4036b0d792
|
Provenance
The following attestation bundles were made for snowpack_stack-0.4.11-py3-none-any.whl:
Publisher:
pypi-publish.yml on snowpackdata/snowpack_stack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snowpack_stack-0.4.11-py3-none-any.whl -
Subject digest:
354fb8378b0658c161227097d523d6a65d883eff8b4f01e9ad7051957c4631e0 - Sigstore transparency entry: 181840997
- Sigstore integration time:
-
Permalink:
snowpackdata/snowpack_stack@299dcdef586bec3613c248f7e59092f2f9e9a3e5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/snowpackdata
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@299dcdef586bec3613c248f7e59092f2f9e9a3e5 -
Trigger Event:
workflow_dispatch
-
Statement type: