Skip to main content

No project description provided

Project description

Snowplow Signals SDK

The Snowplow Signals SDK is a Python SDK that enables you to interact with the Snowplow Signals Profile API. It provides a simple interface to define, deploy, and retrieve user attributes for personalization.

Installation

pip install snowplow-signals

Quickstart

from snowplow_signals import Signals, Attribute, Event, View, domain_sessionid

# Initialize the SDK
signals = Signals(
    api_url="API_URL",
    api_key="API_KEY",
    api_key_id="API_KEY_ID",
    org_id="ORG_ID",
)

# Define an attribute
page_view_count = Attribute(
    name="page_view_count",
    type="int32",
    events=[
        Event(
            vendor="com.snowplowanalytics.snowplow",
            name="page_view",
            version="1-0-0",
        )
    ],
    aggregation="counter"
)

# Create and deploy a view
view = View(
    name="my_view",
    version=1,
    entity=domain_sessionid,
    attributes=[page_view_count],
)
signals.apply([view])

# Retrieve attributes
response = signals.get_view_attributes(
    name="my_view",
    version=1,
    entity="domain_sessionid",
    attributes=["page_view_count"],
    identifiers="abc-123",
)

Key Features

  • Define attributes based on Snowplow events
  • Create views to group related attributes
  • Deploy views to the Profile API
  • Retrieve real-time user attributes

DBT Project Generation

The SDK includes functionality to automatically generate DBT projects for Snowplow data. This makes it easy to set up and maintain DBT projects that work with Snowplow data.

Using the SDK

from snowplow_signals import Signals

# Initialize the signals client
signals = Signals(api_url="https://your-api-url.com")

# Initialize a DBT project
signals.batch_autogen.init_project(
    repo_path="path/to/your/repo",
    project_name="your_project_name"  # Optional
)

# Generate DBT models
signals.batch_autogen.generate_models(
    repo_path="path/to/your/repo",
    project_name="your_project_name",  # Optional
    update=True  # Whether to update existing files
)

Using the Command Line

The SDK also includes a command-line interface for DBT project generation:

# Initialize a DBT project
snowplow-dbt init --repo-path=path/to/your/repo [--project-name=your_project_name] [--api-url=https://your-api-url.com]

# Generate DBT models
snowplow-dbt generate --repo-path=path/to/your/repo [--project-name=your_project_name] [--update]

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

snowplow_signals-0.1.3.tar.gz (38.6 kB view details)

Uploaded Source

Built Distribution

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

snowplow_signals-0.1.3-py3-none-any.whl (58.6 kB view details)

Uploaded Python 3

File details

Details for the file snowplow_signals-0.1.3.tar.gz.

File metadata

  • Download URL: snowplow_signals-0.1.3.tar.gz
  • Upload date:
  • Size: 38.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.13 Linux/6.11.0-1018-azure

File hashes

Hashes for snowplow_signals-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d84ac29c7c09f4f70c612f2b9755f8cbc3a73734eadd96c7dd284214acd3f285
MD5 d25e51268f6947d78f2e4e461a6b677d
BLAKE2b-256 a782d98fd793cf04707ce223412bac5a6c935b0e66bca1cb5050f8f98b9c485b

See more details on using hashes here.

File details

Details for the file snowplow_signals-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: snowplow_signals-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 58.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.13 Linux/6.11.0-1018-azure

File hashes

Hashes for snowplow_signals-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 302f0eff2eaa683cdbb499b53f3966578071a28913edc8f94eb60f3e8fefb6b3
MD5 75bcfc3e353203f834be76e5436f8245
BLAKE2b-256 56b0db909cf1954f60d482861c6a007a73796cb4964698f5399239f84e5d7f40

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