runlight
Runlight is privacy friendly web analytics that runs inside your own Python app. It counts visitors without cookies and without storing anyone’s IP address. The numbers stay in your database, and the dashboard is served from your domain at /runlight.
This package is the Python version of Runlight. It works in Django, Flask, FastAPI, or any WSGI or ASGI app on Python 3.11 or later, and it can also run on its own domain as a standalone server. It answers every request the way the TypeScript library does and uses the same tables, so either one can read the other’s database.
Get started
Install it with pip.
pip install runlight
Create one instance for your app.
from runlight import Runlight
from runlight.store import Stores
rl = Runlight(
store=Stores.sqlite("data/runlight.db"),
site={"name": "example.com", "hostnames": ["example.com"], "timezone": "Europe/London"},
)
Put it in front of your app. In Flask that is one line.
import runlight.flask
runlight.flask.init_app(app, rl)
Add the script to every page, just before </head>.
<script defer src="/runlight/s.js"></script>
Set RUNLIGHT_TOKEN to a long random string, then open /runlight/?token= followed by that string to sign in.
The Python guide has the code for Django, FastAPI, and plain WSGI or ASGI apps, the Postgres, MySQL, and MariaDB stores, the scheduled check, and the standalone server.
License
Runlight is MIT licensed.
Metadata
Release files for runlight 0.1.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 | |
|---|---|---|---|
| runlight-0.1.0.tar.gz | 488.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| runlight-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.0 MB
Release files / runlight-0.1.0.tar.gz
| Download URL | runlight-0.1.0.tar.gz |
|---|---|
| Size | 488.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3aabb148ad81e7ccdcb5eaeb0d56dc5f1cb60dc45789a3d5aa505312793e8ea
|
|
BLAKE2b-256 checksum How to use checksums |
1b9c2ed557194bc488e51a9cf0aaea89a71729e2ce8adda27b7f7a7c3fce22e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / runlight-0.1.0-py3-none-any.whl
| Download URL | runlight-0.1.0-py3-none-any.whl |
|---|---|
| Size | 533.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
887e3a5765ed305359c0fb7293103d18531f74a55de85df96e913e91ebfd14da
|
|
BLAKE2b-256 checksum How to use checksums |
9782f539d25f56275d0d1f1e88ad00caaa1e0230ba866aa11dc3ad77c37550e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|