hafas-terminal-app/README.md
2026-06-16 10:25:01 +02:00

95 lines
No EOL
2.5 KiB
Markdown

# 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 communication
- `kivy` (optional): Mobile UI support for future mobile versions
### Tools
- `Git`: Version control
## Installation
### Option 1: Using Nix (Recommended)
1. Clone the repository:
```bash
git clone https://git.miaig.dev/mia/hafas-terminal-app.git
cd hafas-terminal-app
```
2. Enter the Nix development environment:
```bash
nix develop # Modern Nix with flakes
# or
nix-shell # Traditional Nix
```
All dependencies will be automatically configured.
### Option 2: Using pip
1. Clone the repository:
```bash
git clone https://git.miaig.dev/mia/hafas-terminal-app.git
cd hafas-terminal-app
```
2. Create a virtual environment:
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. Install dependencies:
```bash
pip install -r requirements.txt
```
## Usage
Run the application:
```bash
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](./LICENSE) file.
## Contributing
Contributions are welcome! Please feel free to submit issues and pull requests to help improve the application.