No description
  • Python 39.6%
  • CSS 31.9%
  • HTML 19.8%
  • JavaScript 8.7%
Find a file
2026-05-03 18:12:04 +01:00
.github/workflows Update tests.yml 2026-04-07 03:26:58 +01:00
API Changes before error encountered 2026-04-29 14:36:27 +00:00
Depatures Add bustimes service id/slug and backfill 2026-04-17 10:38:08 +01:00
JSON move 2026-04-29 14:03:40 +01:00
main Add TrainRID.date and enhance map UI 2026-04-29 09:47:00 +01:00
Social Include bus_fleet_number in TripLog queries 2026-04-29 03:15:40 +01:00
static Add train-detail refresh, route caching & UI updates 2026-04-28 22:28:58 +01:00
staticfiles Update map.css 2026-04-28 22:43:08 +01:00
Stops Add comprehensive test suite and CI workflow 2026-04-07 03:20:36 +01:00
Templates added middlewary to prevent the db error 2026-05-02 06:30:15 +01:00
tools a 2026-04-28 22:31:50 +01:00
TransportStatistics added middlewary to prevent the db error 2026-05-02 06:30:15 +01:00
Trips patch 2026-05-03 18:12:04 +01:00
.DS_Store Add Route model, admin and parser updates 2026-04-12 01:40:18 +01:00
.env.example Add docs and .env; tidy code and logging 2026-04-07 01:57:56 +01:00
.gitattributes Initial commit 2026-03-20 16:32:26 +00:00
.gitignore Update .gitignore 2026-04-28 22:32:08 +01:00
CODE_OF_CONDUCT.md Add docs and .env; tidy code and logging 2026-04-07 01:57:56 +01:00
CONTRIBUTING.md Add docs and .env; tidy code and logging 2026-04-07 01:57:56 +01:00
extra-requirements.txt Populate lat/long for several stations 2026-04-13 21:44:27 +01:00
fix_rail_coords.py Populate lat/long for several stations 2026-04-13 21:44:27 +01:00
GETTING_STARTED.md Update GETTING_STARTED.md 2026-04-07 03:10:21 +01:00
LICENSE Initial commit 2026-03-20 16:32:26 +00:00
manage.py Initial commit 2026-03-20 16:32:26 +00:00
MANAGEMENT_COMMANDS.md Update MANAGEMENT_COMMANDS.md 2026-04-07 03:13:37 +01:00
map.json Add train fleet API and rail completion backfill 2026-04-07 01:49:40 +01:00
railpack.json Create railpack.json 2026-03-21 00:59:34 +00:00
README.md Add ts-schedule-updater tool and timestamp fields 2026-04-07 03:06:23 +01:00
requirements.txt Add rail fleet search + import pipeline 2026-04-07 00:44:47 +01:00
SECURITY.md Add docs and .env; tidy code and logging 2026-04-07 01:57:56 +01:00
stations copy.json Populate lat/long for several stations 2026-04-13 21:44:27 +01:00
stations.json Fix apostrophe casing in station names 2026-04-13 22:22:24 +01:00
stations.py Add docs and .env; tidy code and logging 2026-04-07 01:57:56 +01:00

TransportStatistics

TransportStatistics is a Django project for logging journeys and serving rail/bus stop and departure data through HTML pages and REST endpoints.

Features

  • Trip logging with social/privacy controls.
  • Stops API with text, type, active-state, and bounding-box filters.
  • Train and bus departure APIs.
  • Bulk import commands for timetable and stop datasets.

Tech Stack

  • Python 3.10+
  • Django 5.x
  • Django REST Framework
  • MySQL/PostgreSQL/SQLite (via DATABASE_URL)

Quick Start

  1. Create a virtual environment and install dependencies:
    python -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    
  2. Copy environment template and adjust values:
    cp .env.example .env
    
  3. Run migrations and start development server:
    python manage.py migrate
    python manage.py runserver
    

See GETTING_STARTED.md for import workflows and dataset setup. Full command reference: MANAGEMENT_COMMANDS.md. Standalone schedule updater package: tools/schedule_updater.

Logging (toggleable)

Logging is controlled through environment variables:

  • LOGGING_ENABLED=True|False (default True)
  • LOG_LEVEL=DEBUG|INFO|WARNING|ERROR|CRITICAL (default INFO)

Example:

LOGGING_ENABLED=True LOG_LEVEL=DEBUG python manage.py runserver

Open Source Metadata