Skip to main content

Custom telemetry client for Reo (POST JSON to telemetry.reo.dev)

Project description

reo-census (Python)

Send custom telemetry events to Reo’s ingestion API. Defaults to https://telemetry.reo.dev/data (same as the npm reo-census tracker).

Install

pip install reo-census

Usage

Each send uses a JSON body shaped like:

{
  "event": "package_download",
  "package": "<your_package>",
  "version": "1.0.0"
}

Set your package name and version on the logger; optional extra keys can be passed to log_event (they are merged in and override defaults where keys overlap). All values are sent as strings.

from reo_census import ReoEventLogger

logger = ReoEventLogger(
    endpoint_url="https://telemetry.reo.dev/data",
    timeout=3.0,
    package_name="my-package",
    package_version="1.0.0",
)
# Default: non-blocking — HTTP runs in a background thread; returns True if queued.
ok = logger.log_event()

# Add or override fields:
ok = logger.log_event({"region": "us-east-1"})

# Wait for the HTTP round-trip (tests, debugging, or short-lived scripts):
ok = logger.log_event(blocking=True)
  • blocking=False (default): returns True if the event was queued, False if opted out, URL rejected, or payload too large. Does not reflect HTTP success.
  • blocking=True: returns True only after a successful HTTP 2xx (with retries), False on failure or opt-out.

Short-lived programs (one-shot CLI) should use blocking=True or the process may exit before the daemon thread finishes sending.

Opt-out

Respected when any of these apply:

  • PACKAGE_TRACKER_ANALYTICS=false
  • DO_NOT_TRACK is 1, true, or yes (case-insensitive)

Endpoint override

Set PACKAGE_TRACKER_ENDPOINT to override the URL (same as the Node tracker). Only http:// and https:// URLs with a host are accepted.

Verbose logging

Set PACKAGE_TRACKER_VERBOSE=true to print send details to stderr.

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

reo_census-0.1.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

reo_census-0.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file reo_census-0.1.1.tar.gz.

File metadata

  • Download URL: reo_census-0.1.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for reo_census-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b54835cf054b8514384ba23a893e66e6dad2b1ef3af8cb9b16b156a1aefd7e19
MD5 6adafeced2792b21be76a2aa24a8bfdf
BLAKE2b-256 6aa37d3d5dc469886d9f8ac3d49b1db1fdf32d95f7d566c1fa9e324afc5183ca

See more details on using hashes here.

File details

Details for the file reo_census-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: reo_census-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for reo_census-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b45d48a36cb68367cdeca64bf5f0df5595f7e5bee89a908073ed04991555054
MD5 3b1fad0aaa602822100f3cdf59fd52eb
BLAKE2b-256 97ec631a0c73d5ecc6ca420f34f99314f65098ca07b5c1ab32bcd24af95545ac

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