Skip to main content

junglans-trail

Embedded local-first analytics & on-page heatmap middleware for Python (FastAPI & Starlette).
Developed by Junglansjunglans.in

104 Capabilities. Zero standalone servers. Store all analytics and user telemetry directly in your application's local SQLite database under /api/jungtrail.


Installation

With uv (Recommended)

uv add junglans-trail

With pip

pip install junglans-trail

30-Second Quickstart (FastAPI)

Mount the analytics router onto your existing FastAPI app in 3 lines:

from fastapi import FastAPI
from junglans_trail import jungtrail_fastapi_middleware

app = FastAPI()

# Mounts all 104 analytics, heatmap, auth, and e-commerce endpoints under /api/jungtrail
storage = jungtrail_fastapi_middleware(
    app,
    db_name="analytics.db",       # Custom SQLite WAL database name
    db_path="data/analytics.db",  # Custom database storage path
    admin_key="your-admin-secret" # Protects stats, export, and heatmap endpoints
)

@app.get("/")
def home():
    return {"message": "Hello from Junglans Trail"}

Backend Event Tracking in Python

Track backend business, auth, and e-commerce events directly from Python:

from junglans_trail import TrailClient

client = TrailClient(
    endpoint="http://localhost:8000/api/jungtrail",
    write_key="optional-key"
)

# E-Commerce transaction
client.track(
    event_type="purchase",
    route="/checkout/success",
    meta={"order_id": "ord_9901", "revenue": 149.00, "items_count": 2}
)

# Auth & session telemetry
client.track(
    event_type="login_success",
    route="/api/v1/auth/login",
    meta={"provider": "github", "user_id": "usr_abc"}
)

client.flush()

REST Endpoints Overview

Route Method Description
/api/jungtrail/events POST Ingest batch telemetry events
/api/jungtrail/heatmap GET Coordinates for live visual DOM heatmap
/api/jungtrail/stats GET Core analytics: clicks, views, scroll, errors, vitals
/api/jungtrail/stats/ecommerce GET Revenue, orders, AOV, cart additions & drop-offs
/api/jungtrail/stats/experiments GET A/B testing variants, conversions, feature flags
/api/jungtrail/stats/feedback GET NPS score (Promoter/Passive/Detractor), CSAT, notes
/api/jungtrail/stats/auth GET Login rates, registration funnel, password resets, MFA
/api/jungtrail/stats/session GET Active sessions, duration, bounce rate, multi-tab sync
/api/jungtrail/session/stitch POST Retroactively stitch anonymous session to user ID
/api/jungtrail/session/purge POST/DELETE GDPR right-to-erasure user/session purge
/api/jungtrail/export GET Export database in JSON or CSV format
/api/jungtrail/backup GET Full SQLite database snapshot backup
/api/jungtrail/health GET Public status and version check

Developer & Organization

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

junglans_trail-0.6.0.tar.gz (44.5 kB view details)

Uploaded Source

Built Distribution

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

junglans_trail-0.6.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file junglans_trail-0.6.0.tar.gz.

File metadata

  • Download URL: junglans_trail-0.6.0.tar.gz
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for junglans_trail-0.6.0.tar.gz
Algorithm Hash digest
SHA256 7097b77ce61f6548b7e569927165826ca340c09c8d80c3475e684bce0a95a890
MD5 bea778c3c2558344dff1705918d8efe3
BLAKE2b-256 2242ab907e8bdaa84e3795456ea76f85718291d391c0de5db943e0f5879e1a40

See more details on using hashes here.

File details

Details for the file junglans_trail-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: junglans_trail-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for junglans_trail-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3655a191347fc926179b008bf3ef64f2dd4a8c3ae806ede1395ee7930f0ba34
MD5 7ed2c70c844abac187010152ade790e7
BLAKE2b-256 125bab142a900297c571d7d993c5b06fdc1ed0045deeff9bdf48f782fb6d4a2e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page