PYPIv0.1.0Python 3.8+ (FastAPI & Starlette)MIT License
junglans-trail
Embedded Local-First Analytics & On-Page Heatmap Middleware for Python (FastAPI & Starlette)
Zero standalone servers. Store all telemetry, on-page heatmap coordinates, e-commerce transactions, and diagnostic events directly in your Python application's local SQLite database under /api/jungtrail with 104 capabilities built-in.
CAPABILITIES
104
FRAMEWORK
FastAPI / Starlette
DATABASE
SQLite WAL
SETUP TIME
<30s
1. Installation
Install junglans-trail using your favorite package manager. All dependencies are minimal and zero-leakage.
Install Command
pip install junglans-trail2. Quickstart & Implementation
Get up and running in less than 30 seconds. Copy and paste the code snippets below directly into your codebase.
Code Examples
from fastapi import FastAPI
from junglans_trail import jungtrail_fastapi_middleware
app = FastAPI(title="My Enterprise Service")
# Mount all 104 analytics, heatmap, and telemetry endpoints under /api/jungtrail
storage = jungtrail_fastapi_middleware(
app,
db_name="analytics.db", # Custom SQLite WAL database
db_path="data/analytics.db", # Storage path
admin_key="your-admin-secret" # Protects stats, export, and heatmap endpoints
)
@app.get("/")
def home():
return {"message": "Hello from Junglans Trail"}
File: main.pypython
3. REST Ingestion & Analytics Endpoints
All endpoints are mounted automatically onto your host server under /api/jungtrail.
| Method | Endpoint | Authorization | Description |
|---|---|---|---|
| POST | /api/jungtrail/events | Admin / Write Key | Ingest batch telemetry events from client or server. |
| GET | /api/jungtrail/heatmap | Admin / Write Key | Retrieve spatial coordinates for live visual DOM heatmaps. |
| GET | /api/jungtrail/stats | Admin / Write Key | Aggregate core metrics: clicks, page views, scroll depth, error rates. |
| GET | /api/jungtrail/stats/ecommerce | Admin / Write Key | Revenue metrics, conversion rates, cart abandonment data. |
| GET | /api/jungtrail/export | Admin / Write Key | Export captured telemetry in JSON or CSV format. |