Metro Bilbao CLI Schedule Application
December 16, 2024 ยท View on GitHub
Metro Bilbao CLI Schedule Application
This is a Command-Line Interface (CLI) application to check train schedules for the Metro Bilbao system. The application provides a user-friendly interface with interactive menus, allowing you to select origin and destination stations, view real-time train schedules, and configure default trips.
The interface is enhanced using the rich library for better visualization.
Warning
This application is NOT OFFICIAL and is developed for educational purposes only. The developers are not responsible for any misuse of this application. The API used belongs to Metro Bilbao.
Features
- Real-Time Train Schedules: Fetch real-time train data between selected stations.
- Interactive Station Selection: Choose origin and destination stations from a list.
- Default Trips: Save your preferred origin and destination for quick access.
- Clear Interface: Automatically clears the terminal between screens for a clean user experience.
- Beautiful Visuals: Styled text, tables, and menus for easy navigation.
Prerequisites
Ensure you have the following installed:
- Python 3.8 or higher
- Internet connection (to fetch real-time train schedules)
Required Python libraries:
requestsrich
Install the required libraries with:
pip install -r requirements.txt
Optional: Install Required Libraries in a Virtual Environment
If you'd like to isolate your project dependencies, you can create and use a virtual environment. Follow these steps:
-
Create a virtual environment:
python3 -m venv venv -
Activate the virtual environment:
-
On Windows:
.\venv\Scripts\activate -
On macOS/Linux:
source venv/bin/activate
-
-
Install the required libraries: With the virtual environment active, run:
pip install -r requirements.txt -
Run the Application (see "Run the Application")
-
Deactivate the virtual environment when you're done:
deactivate
deactivate
How to Use
Clone the Repository
git clone https://github.com/kirisuoc/metrobilbao-now/ && cd metrobilbao-now
Run the Application
Execute the application with:
python metro.py
Menu Options
When you run the application, you'll see a menu like this:
1 - Travel Now
2 - Default Trip
3 - Settings
4 - Exit
Option Descriptions
-
Travel Now:
- Select an origin and destination station from the list.
- View real-time train schedules between the selected stations.
-
Default Trip:
- Fetch schedules for your saved origin and destination stations.
- You can reset these stations in the settings.
-
Settings:
- Update your default origin and destination stations.
-
Exit:
- Close the application.
Example Usage
Travel Now
- Select
1 - Travel Now. - Choose your origin and destination stations from the interactive list.
- View the real-time train schedule in a neatly formatted table.
Default Trip
-
Set your default stations in the Settings menu.
-
Select
2 - Default Tripfor instant schedule access.
Contribution
Feel free to fork this repository and submit pull requests for improvements or additional features.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Author
Developed by E10Y and kirisuoc.
For any issues or suggestions, please open a GitHub issue.