Skip to main content

Python SDK for Sentinel Analytics Realm

Project description

Sentinel Analytics Realm - Python SDK

Thin Python client for tracking events in the Sentinel Analytics Realm.

Installation

From PyPI (Public Channel)

pip install sentinel-analytics-realm-python

From Source (Local Development)

git clone https://github.com/savant-realms/sentinel-analytics-realm-python.git
cd sentinel-analytics-realm-python
pip install -e .

Usage

from sdk.sdk import SentinelAnalyticsRealmPlugin

# Initialize the plugin
sentinelAnalyticsRealm = SentinelAnalyticsRealmPlugin(
    project_id="YOUR_PROJECT_ID",
    app_id="YOUR_APP_ID",
    access_token="YOUR_ACCESS_TOKEN",
)

# Track an event
sentinelAnalyticsRealm.track("page_view", visitor_id="v_123")

# Identity linking
sentinelAnalyticsRealm.identify(user_id="u_456", visitor_id="v_123", traits={"email": "user@example.com"})

# Batch tracking
sentinelAnalyticsRealm.track_batch([
    {"name": "click", "visitor_id": "v_123", "properties": {"button": "buy"}},
    {"name": "hover", "visitor_id": "v_123"}
])

Configuration fallback

The SDK will automatically attempt to read configuration from environment variables if not provided in the constructor:

  • SENTINEL_ANALYTICS_REALM_PROJECT_ID
  • SENTINEL_ANALYTICS_REALM_APP_ID
  • SENTINEL_ANALYTICS_REALM_ENV
  • SENTINEL_ANALYTICS_REALM_URL (Defaults to https://api.sentinelanalyticsrealm.com)

Local release (maintainers)

  • Prepare .env at repo root with at least:
    • PYPI_TOKEN=pypi-... (Upload scope)
    • Optional GitLab upload:
      • GITLAB_PROJECT_ID=...
      • GITLAB_USERNAME=...
      • GITLAB_TOKEN=... (PAT with api scope or Deploy Token)
  • Run:
    • scripts/deploy.sh to build, validate, and upload.
    • DRY_RUN=true scripts/deploy.sh to build + check only.

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

sentinel_analytics_realm_python-0.0.3.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file sentinel_analytics_realm_python-0.0.3.tar.gz.

File metadata

File hashes

Hashes for sentinel_analytics_realm_python-0.0.3.tar.gz
Algorithm Hash digest
SHA256 638213123a0f35756741583b2f57670ce534dc4971190d0d53f8496f3a643ee6
MD5 611fa2f9f881c08848a960d792bc368c
BLAKE2b-256 d17e68bed290bfba0e8ac9e8c796da4f033cd8f1d3772c1a48cf5597186cbc6d

See more details on using hashes here.

File details

Details for the file sentinel_analytics_realm_python-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for sentinel_analytics_realm_python-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d232e77983f442d379f1f8a31e791b3faad484702c4ed826be9457bfbd655139
MD5 1189c42db02d245cdd5fcfdb3bfed41c
BLAKE2b-256 37207077c95ddece1e06e40b1d385bf44645cc58022b583bb4dba0a74bb744d0

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