junglans-trail
Embedded local-first analytics & on-page heatmap middleware for Python (FastAPI & Starlette).
Developed by Junglans • junglans.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
- Organization: Junglans
- Website: https://junglans.in
- Email: contact@junglans.in
- License: MIT
Metadata
Release files for junglans-trail 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| junglans_trail-0.6.0.tar.gz | 44.5 kB | Without provenance | Details for junglans_trail-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| junglans_trail-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for junglans_trail-0.6.0-py3-none-any.whl |
Total release size: 56.7 kB
Release files / junglans_trail-0.6.0.tar.gz
| Download URL | junglans_trail-0.6.0.tar.gz |
|---|---|
| Size | 44.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7097b77ce61f6548b7e569927165826ca340c09c8d80c3475e684bce0a95a890
|
|
BLAKE2b-256 checksum How to use checksums |
2242ab907e8bdaa84e3795456ea76f85718291d391c0de5db943e0f5879e1a40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / junglans_trail-0.6.0-py3-none-any.whl
| Download URL | junglans_trail-0.6.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3655a191347fc926179b008bf3ef64f2dd4a8c3ae806ede1395ee7930f0ba34
|
|
BLAKE2b-256 checksum How to use checksums |
125bab142a900297c571d7d993c5b06fdc1ed0045deeff9bdf48f782fb6d4a2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Security for junglans-trail 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.