Registry / http-networking / minimal-snowplow-tracker

minimal-snowplow-tracker

JSON →
library0.0.2pypypi✓ verified 24d ago

minimal-snowplow-tracker is a Python library that provides a minimal event tracker for Snowplow analytics. It is a fork of the original `snowplow-python-tracker` (v0.8.0), stripped down to include only basic emitters and support for structured and unstructured event tracking. Last released in 2018 as version 0.0.2, it is primarily maintained as an internal dependency for projects like dbt-core for anonymous usage tracking, rather than an actively developed standalone library.

pip install minimal-snowplow-tracker
INSTALL
IMPORT
SIG · MINIMAL-SNOWPLOW-T
M
minimal-snowplow-tracker
http-networkingpythonv0.0.2
Install
3.0s avg
Import
372ms
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.378s · 22.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.0s · import 0.366s · 23MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Tracker
from snowplow_tracker import Tracker
from minimal_snowplow_tracker import Tracker
Despite being installed as `minimal-snowplow-tracker`, the package uses the `snowplow_tracker` namespace internally, which can cause import conflicts if the official `snowplow-tracker` library is also installed.
Emitter
from snowplow_tracker import Emitter
This minimal fork only retains the basic Emitter. Other emitters (e.g., Kafka, AMQP) from the original tracker are removed.

This quickstart demonstrates how to initialize the tracker and send a structured event and an unstructured event. It uses the `snowplow_tracker` import path, which is the internal module name for `minimal-snowplow-tracker`. You will need a running Snowplow Collector (e.g., Snowplow Mini) at `COLLECTOR_URL` to receive events.

import os from snowplow_tracker import Tracker, Emitter from snowplow_tracker.self_describing_json import SelfDescribingJson # Replace with your Snowplow Collector endpoint COLLECTOR_URL = os.environ.get('SNOWPLOW_COLLECTOR_URL', 'http://localhost:9090') # Initialize an emitter to send events to the collector emitter = Emitter(COLLECTOR_URL) # Initialize the tracker with a namespace and application ID tracker = Tracker(emitters=[emitter], namespace='my_app_namespace', app_id='my-python-app') # Track a structured event tracker.track_struct_event( category='example_category', action='example_action', label='example_label', property='example_property', value=1.0 ) # Track an unstructured event with a self-describing JSON schema example_schema = 'iglu:com.example_company/example_event/jsonschema/1-0-0' example_data = { 'event_detail': 'This is an unstructured event', 'session_id': 'abc-123' } unstructured_event = SelfDescribingJson(example_schema, example_data) tracker.track_unstruct_event(unstructured_event) print(f"Events sent to {COLLECTOR_URL} using minimal-snowplow-tracker.") # In a real application, you might want to gracefully close the emitter or ensure all events are sent. # For simple scripts, events are often sent synchronously or on program exit.
Debug
Known issues
breakingThis library (version 0.0.2) is a highly minimal fork of the original `snowplow-python-tracker` (v0.8.0). It has removed all emitters except the basic one and all tracking event methods except for structured and unstructured events. Functionality available in newer versions of the official `snowplow-tracker` will not be present.
fix
For comprehensive and up-to-date Snowplow tracking features, use the actively maintained `snowplow-tracker` library (pypi.org/project/snowplow-tracker/). If `minimal-snowplow-tracker` is a dependency, consider whether the older, limited functionality is sufficient or if an alternative tracking approach is needed.
affects: 0.0.2
gotchaThe `minimal-snowplow-tracker` package, when installed, exposes its functionality under the `snowplow_tracker` Python module namespace. This creates a direct import conflict if the official, actively maintained `snowplow-tracker` library is also installed in the same environment, as both will try to provide modules under the same `snowplow_tracker` path.
fix
Avoid installing `minimal-snowplow-tracker` alongside the official `snowplow-tracker` in the same Python environment. If `minimal-snowplow-tracker` is a transitive dependency (e.g., via `dbt-core`), be aware of this potential conflict and manage your environment carefully, perhaps using virtual environments.
affects: 0.0.2
deprecated`minimal-snowplow-tracker` was last updated in October 2018 and officially supports Python up to 3.7. It is not actively maintained as a public library and is significantly behind the upstream `snowplow-python-tracker`. Using it with newer Python versions might lead to compatibility issues.
fix
Migrate to the official and actively maintained `snowplow-tracker` library for Python. If adherence to Python 3.7 or earlier is required, ensure rigorous testing for compatibility.
affects: 0.0.2
gotchaThe PyPI page for `minimal-snowplow-tracker` points to the `snowplow/snowplow-python-tracker` GitHub repository for its 'Contributing quickstart', which describes a testing setup and not a typical application usage. This reinforces that `minimal-snowplow-tracker` is not designed for direct end-user application integration, and its documentation is not for its specific minimal feature set.
fix
If you intend to use a Snowplow Python tracker, consult the official documentation and GitHub for the actively maintained `snowplow-tracker` library to ensure correct implementation and access to supported features.
affects: 0.0.2
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'minimal_snowplow_tracker'
The `minimal-snowplow-tracker` package is not installed in the current Python environment or the Python path is not correctly configured.
fix
Install the package using pip: `pip install minimal-snowplow-tracker`
ERROR: Failed building wheel for minimal-snowplow-tracker
The `minimal-snowplow-tracker` library is an older package (v0.0.2, last released 2018) and may not fully support modern Python packaging standards (like PEP 517) used by newer `pip` or Poetry, especially on newer Python versions.
fix
Try installing with a legacy builder: `pip install --no-use-pep517 minimal-snowplow-tracker`. If using Poetry, an older version (<=1.4.2) that allows specifying a legacy installer might be necessary.
AttributeError: module 'enum' has no attribute 'IntFlag'
This error often occurs when `minimal-snowplow-tracker` (or a dependency, such as when `dbt-core` installs it) is used in a Python environment where `enum.IntFlag` is not available, typically Python versions older than 3.6, or due to a conflict with a specific version of a dependency.
fix
Ensure you are using Python 3.6 or newer. If the error persists, check for specific dependency conflicts within your environment or consider isolating `minimal-snowplow-tracker` in a dedicated virtual environment with compatible Python and dependency versions.
minimal snowplow tracker and snowplow python tracker are incompatible
`minimal-snowplow-tracker` is a fork of an older `snowplow-python-tracker` and both libraries may install modules into the same `snowplow_tracker` namespace. Installing both in the same environment can lead to overwrites and unexpected behavior or errors when trying to use features from one or the other.
fix
Avoid installing both `minimal-snowplow-tracker` and `snowplow-tracker` in the same Python environment. If `dbt-core` is a dependency, note that newer `dbt-core` versions are migrating to the official `snowplow-tracker`.
Upgrade
Version history
0.0.2latest on PyPI · released Oct 13, 2018
Audit
Dependencies
requestsrequiredHTTP requests for sending events
pikaoptionalAMQP emitter (removed in this minimal fork, but might be a vestigial dependency if not fully cleaned)
kafka-pythonoptionalKafka emitter (removed in this minimal fork, but might be a vestigial dependency if not fully cleaned)
Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
2
Resources