Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚗 Traffic Analysis: Palaiseau ↔ Paris

A Streamlit app analyzing commute time data (collected from a GPS API) between Palaiseau and Paris, used to find the best time of day to travel.

Project structure

traffic_analysis/
├── app.py                  # Streamlit UI
├── src/
│   └── data_loader.py       # Data loading/filtering logic (unit tested)
├── tests/
│   └── test_data_loader.py  # Pytest suite
├── data/
│   ├── data_X_solfe.json    # Palaiseau -> Paris trip records
│   └── data_solfe_X.json    # Paris -> Palaiseau trip records
├── Dockerfile
├── requirements.txt
├── requirements-dev.txt
└── .github/workflows/ci.yml # CI: lint, test, Docker build

Data format

Each JSON file is a list of trip records:

{
  "timestamp": "2025-10-05T15:12:52.076311",
  "duration_seconds": 2319,
  "duration_minutes": 38.65,
  "distance_meters": 26041,
  "distance_km": 26.041,
  "base_duration": 1921,
  "traffic_delay": 398
}

Running locally

python -m venv venv
source venv/bin/activate
pip install -r requirements-dev.txt
streamlit run app.py

Running tests

pytest tests/ -v --cov=src

Running with Docker

docker build -t traffic-analysis .
docker run -p 8501:8501 traffic-analysis

Then open http://localhost:8501.

CI

GitHub Actions (.github/workflows/ci.yml) runs on every push/PR to main:

  1. Lints src/ and app.py with flake8
  2. Runs the pytest suite (with coverage) on Python 3.11 and 3.12
  3. Builds the Docker image to confirm it's buildable

Reproducibility notes

  • Dependencies are pinned in requirements.txt / requirements-dev.txt.
  • Data loading and transformation logic lives in src/data_loader.py, separate from the Streamlit UI, so it can be unit tested without a browser.
  • The Docker image installs dependencies before copying code, so rebuilds are fast when only app logic changes.

About

collecting data concerning traffic time between school and home to find best moment to drive there

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages