Skip to main content

DataGuild Snowflake Connector - Enterprise-grade metadata ingestion

Project description

DataGuild Snowflake Connector

PyPI version Python Support License Downloads

Enterprise-grade Snowflake metadata ingestion connector for DataGuild platform with comprehensive lineage tracking, usage analytics, and data governance capabilities.

🚀 Features

  • Complete Metadata Extraction: Tables, views, streams, procedures, functions, and more
  • Advanced Lineage Tracking: Table-to-table and column-level lineage with SQL parsing
  • Usage Analytics: Comprehensive usage statistics and operational metrics
  • Data Governance: Tag extraction and classification support
  • Production Ready: Enhanced error handling, monitoring, and structured logging
  • Scalable: Optimized for enterprise-scale Snowflake deployments
  • CLI Support: Easy-to-use command-line interface
  • Flexible Configuration: YAML-based configuration system

📦 Installation

From PyPI (Recommended)

pip install dataguild-snowflake-connector

From Source

git clone https://github.com/dataguild/snowflake-connector.git
cd snowflake-connector
pip install -e .

🚀 Quick Start

Basic Usage

from dataguild_snowflake_connector import SnowflakeV2Source, SnowflakeV2Config

# Configure your Snowflake connection
config = SnowflakeV2Config(
    account="your-account.snowflakecomputing.com",
    user="your-username",
    password="your-password",
    warehouse="your-warehouse",
    database="your-database",
    schema="your-schema"
)

# Create and run the source
source = SnowflakeV2Source(config)
source.run()

Command Line Interface

# Basic usage
dataguild-snowflake --config config.yml --output metadata.json

# With specific options
dataguild-snowflake \
  --account your-account \
  --user your-username \
  --password your-password \
  --warehouse your-warehouse \
  --database your-database \
  --output metadata.json

Configuration File

Create a config.yml file:

account: "your-account.snowflakecomputing.com"
user: "your-username"
password: "your-password"
warehouse: "your-warehouse"
database: "your-database"
schema: "your-schema"

# Optional settings
include_usage_stats: true
include_lineage: true
include_tags: true
max_workers: 4

📚 Documentation

API Reference

SnowflakeV2Config

Configuration class for Snowflake connection parameters.

class SnowflakeV2Config:
    account: str
    user: str
    password: str
    warehouse: str
    database: str
    schema: Optional[str] = None
    include_usage_stats: bool = True
    include_lineage: bool = True
    include_tags: bool = True
    max_workers: int = 4

SnowflakeV2Source

Main source class for metadata extraction.

class SnowflakeV2Source:
    def __init__(self, config: SnowflakeV2Config)
    def run(self) -> Dict[str, Any]
    def extract_metadata(self) -> Dict[str, Any]
    def extract_lineage(self) -> Dict[str, Any]
    def extract_usage_stats(self) -> Dict[str, Any]

Advanced Usage

Custom Configuration

from dataguild_snowflake_connector import SnowflakeV2Source, SnowflakeV2Config

config = SnowflakeV2Config(
    account="your-account",
    user="your-user",
    password="your-password",
    warehouse="your-warehouse",
    database="your-database",
    # Advanced options
    include_usage_stats=True,
    include_lineage=True,
    include_tags=True,
    max_workers=8,
    connection_timeout=300,
    query_timeout=600
)

source = SnowflakeV2Source(config)
metadata = source.run()

Error Handling

from dataguild_snowflake_connector import SnowflakeV2Source, SnowflakeV2Config
import logging

# Configure logging
logging.basicConfig(level=logging.INFO)

try:
    config = SnowflakeV2Config(...)
    source = SnowflakeV2Source(config)
    metadata = source.run()
    print(f"Successfully extracted metadata for {len(metadata.get('tables', []))} tables")
except Exception as e:
    logging.error(f"Failed to extract metadata: {e}")

🧪 Testing

Run the test suite:

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run with coverage
pytest --cov=dataguild

# Run specific test categories
pytest tests/unit/
pytest tests/integration/
pytest tests/performance/

📊 Output Format

The connector outputs structured metadata in JSON format:

{
  "tables": [...],
  "views": [...],
  "procedures": [...],
  "functions": [...],
  "lineage": [...],
  "usage_stats": [...],
  "tags": [...],
  "extraction_summary": {
    "total_objects": 150,
    "extraction_time": "2024-01-01T12:00:00Z",
    "duration_seconds": 45.2
  }
}

🔧 Development

Setup Development Environment

git clone https://github.com/dataguild/snowflake-connector.git
cd snowflake-connector
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e ".[dev]"

Code Quality

# Format code
black dataguild/

# Sort imports
isort dataguild/

# Lint code
flake8 dataguild/

# Type checking
mypy dataguild/

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

📄 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

🆘 Support

🗺️ Roadmap

  • Support for additional Snowflake object types
  • Enhanced lineage visualization
  • Real-time metadata streaming
  • Integration with additional data catalogs
  • Advanced data quality metrics

📈 Changelog

See CHANGELOG.md for a detailed list of changes.

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

dataguild_snowflake_connector-1.0.0.tar.gz (65.5 kB view details)

Uploaded Source

Built Distribution

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

dataguild_snowflake_connector-1.0.0-py3-none-any.whl (69.3 kB view details)

Uploaded Python 3

File details

Details for the file dataguild_snowflake_connector-1.0.0.tar.gz.

File metadata

File hashes

Hashes for dataguild_snowflake_connector-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f47616eaa30478d978b14cea514fb5c6bd26e1550cc39c77fa208a5c0fea1e98
MD5 14ef27ec7c1ef3b9efc3b2cd76ecdf7f
BLAKE2b-256 9a59bb98c0742500469005eb4b271505171266ebb0f3308502a3cf528fb6f901

See more details on using hashes here.

File details

Details for the file dataguild_snowflake_connector-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dataguild_snowflake_connector-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 411d0f4de99b6e897a0e0b4114a64d015553bb5d716698f62ccb0d8f85f3d291
MD5 a29d6ce7417636ee88c9a68a66535d11
BLAKE2b-256 f5d57e23153ae7c226e1afea70ede31c5c8a86b21839e89cb1b9faf4f27beb74

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