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",
    ingest_token="YOUR_INGEST_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_INGEST_TOKEN
  • 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.2.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.2.tar.gz.

File metadata

File hashes

Hashes for sentinel_analytics_realm_python-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a21c37cbeeafc1c620f590712b323e4fef37dc3512e0de6a5c20b5ab924085b2
MD5 f388c8f551552fadc7d195c5d1a5c6f6
BLAKE2b-256 bfc897d291d2f67c08e64f5ff7a15fbce0d9d5cd9b60c4f257fd331365f92ee4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sentinel_analytics_realm_python-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 15464d836ccc3a4a428514cebb0a22f6be8a8daf3c307d7031ee7ec9b667b381
MD5 5216090acb8c363362ab1ae78274b99f
BLAKE2b-256 ca2a75cefe6c0a8bd9ad88529ce18c4de03ae258ad9d21fc376c64f93dd35adf

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