2.5 KiB
2.5 KiB
hafas-terminal-app
A Python-based terminal application for accessing public transport information via the HAFAS API. This tool provides station-to-station route planning and real-time arrival/departure information for public transport networks.
Features
- Route Planning: Find optimal routes between stations
- Station Information: View real-time arrivals and departures
- Terminal UI: User-friendly command-line interface using prompt_toolkit
- Multiple Transport Methods: Support for various public transport modes
Requirements
Core Dependencies
- Python 3.7+: Programming language
- Hafas API Endpoint: Access to a HAFAS public transport API
Python Packages
prompt_toolkit: Terminal user interface (TUI)requests: HTTP library for API communicationkivy(optional): Mobile UI support for future mobile versions
Tools
Git: Version control
Installation
Option 1: Using Nix (Recommended)
-
Clone the repository:
git clone https://git.miaig.dev/mia/hafas-terminal-app.git cd hafas-terminal-app -
Enter the Nix development environment:
nix develop # Modern Nix with flakes # or nix-shell # Traditional Nix
All dependencies will be automatically configured.
Option 2: Using pip
-
Clone the repository:
git clone https://git.miaig.dev/mia/hafas-terminal-app.git cd hafas-terminal-app -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install dependencies:
pip install -r requirements.txt
Usage
Run the application:
python main.py
Features
- Navigate between stations and search for routes
- View departure and arrival times
- Display detailed journey information
Project Structure
hafas-terminal-app/
├── main.py # Application entry point
├── backend.py # Backend API communication logic
├── route_planning.py # Route planning algorithms
├── station_monitor.py # Station monitoring functionality
├── flake.nix # Nix environment configuration
├── README.md # This file
└── docs/ # Documentation
License
This project is provided under the terms specified in the LICENSE file.
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests to help improve the application.