Skip to content

dratasich/gpx-stats

Repository files navigation

gpx-stats

Dashboard visualizing stats based on gpx files.

Screenshot of the grafana dashboard

Tested with GPX/TCX from:

Setup

# install environment
$ uv run pre-commit install

Usage

Add your gpx files to data (e.g., sync from your phone).

Load gpx files, generate metadata and save to sqlite database:

$ ./import.py data/<file>.gpx

If the file has no tracks (e.g., because its a manual entry) then it will try the tcx file (should contain duration and distance).

Load all gpx files from a folder:

mkdir db
$ ./load.sh data db/gpx.db

Visualize the stats with grafana at localhost:3000 with default username and password admin:admin:

$ docker-compose up
# or with podman
$ podman compose up

Or a speed boxplot with a mini dash app:

$ uv sync --extra dashapp
$ uv run python app.py

Screenshot of the dashapp (= speed boxplot)

Development

Testing

Run tests:

$ uv run pytest

Run integration tests (excluded by default):

$ uv run pytest tests/integration/

Run tests with coverage report:

$ uv run pytest --cov=stats_loader --cov-report=term-missing

Generate HTML coverage report:

$ uv run pytest --cov=stats_loader --cov-report=html
# Open htmlcov/index.html in browser

Database Debugging

Debug database:

sqlite3 db/gpx.db
# list tables
> .tables

List latest entries:

SELECT * FROM files ORDER BY load_timestamp DESC LIMIT 5;

About

Generate and visualize statistic from GPX files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors