Releases: GiZano/traveler-api
🧭 CuriousTrip - Traveler API v2
🚀 Release Notes - Version 2.0 (The Async Update)
Version 2.0 represents a significant architectural evolution from the initial synchronous release.
Key Enhancements:
- Asynchronous Refactoring: Migrated from the
requestslibrary toaiohttp. Utilizingasyncio.gather, the application now performs I/O operations concurrently, resulting in a 3x increase in execution speed. - Directory-Aware Logic: Implemented automated directory creation within the saving utility to prevent runtime errors during the initial file export.
Note: While Version 1.0 (implemented with the same initial README) focused on sequential logic, Version 2.0 is designed for modern, non-blocking performance standards.
🧭 CuriousTrip - Traveler API v1
🧭 CuriousTrip - Traveler API v1
The Curious Traveler (also known as CuriousTrip) is a modular, command-line Python application designed to aggregate and display comprehensive travel data. By orchestrating multiple free public REST APIs, the application allows users to input a destination country and instantly receive a curated travel profile, also known as a "Swindle Sheet".
This project demonstrates practical skills in handling HTTP REST requests, parsing complex JSON payloads, handling exceptions for external services, and orchestrating data from diverse sources into a unified, highly readable CLI interface.
✨ Features
- 🌍 Destination Demographics: Retrieves official name, capital, population, continent, languages, and currency.
- 🌤️ Real-time Weather: Checks the current temperature, wind speed, and weather conditions of the destination's capital.
- 💰 Live Budget Conversion: Converts a user-defined budget from EUR to the destination's local currency using up-to-date exchange rates.
- 🎓 Top Universities: Suggests the top 3 universities located in the chosen country.
- 🍽️ Culinary Suggestions: Recommends a random meal with ingredients to inspire your travel palate.
- 🎲 Entertainment & Trivia: Delivers a random travel joke and a daily cat fact to keep things fun.
- 📸 Daily Space Imagery & Dogs: Fetches NASA's Astronomy Picture of the Day and a random dog picture.
- 💾 Local Data Export: Seamlessly saves the generated travel profile to a local
.txtfile within the/app/data/directory for future reference.
📂 Project Structure
The project follows a clean, modular architecture, separating API logic from data processing and the main CLI loop.
.
├── app/
│ ├── api/
│ │ ├── budget_api.py # ExchangeRate API integration
│ │ ├── cat_api.py # Cat Facts API
│ │ ├── country_api.py # REST Countries API
│ │ ├── dog_api.py # Dog API
│ │ ├── food_api.py # TheMealDB API
│ │ ├── joke_api.py # JokeAPI
│ │ ├── space_api.py # NASA APOD API
│ │ ├── uni_api.py # HipoLabs Universities API
│ │ └── weather_api.py # Open-Meteo API
│ ├── data/ # Generated text profiles are saved here
│ ├── tools/
│ │ └── saver.py # Utility to write data to .txt files
│ ├── info_fetcher.py # Orchestrator that gathers data from all APIs
│ └── main.py # Entry point and CLI UI loop
├── .gitignore # Ignores __pycache__, venv, and data files
├── README.md # Project documentation
└── requirements.txt # Project dependencies
🚀 Installation & Setup
- Clone the repository:
git clone https://github.com/yourusername/traveler-api.git
cd traveler-api- Create and activate a virtual environment (Recommended):
# On macOS/Linux
python3 -m venv venv
source venv/bin/activate
# On Windows
python -m venv venv
venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt💻 Usage
Run the main application script from the root directory. Make sure your PYTHONPATH allows for the local imports:
python app/main.pyStep-by-step Execution:
- The app will welcome you with a retro ASCII banner.
- You will be prompted to
Insert a country name:(e.g., Japan, Italy). - Next, you will provide an available budget in EUR:
Insert the available budget (EUR):(e.g., 500). - The orchestrator will fetch all data from the various APIs and print a fully structured "CuriousTrip Swindle Sheet" to your terminal.
- Finally, you can choose to save the output locally:
Would you like to save the sheet? (Y/N):. If accepted, it will be saved insideapp/data/.
🔗 APIs Orchestrated
This project successfully integrates 9 different external APIs to compile its profiles:
- REST Countries API - Core geographical and demographic data.
- Open-Meteo API - Geographic coordinate-based live weather tracking.
- ExchangeRate API - Live currency exchange rates.
- TheMealDB API - Random recipe and ingredient generation.
- HipoLabs Universities API - Educational institutions list.
- Cat Facts API - Daily trivia generation.
- JokeAPI - Safe, single-string programming/general jokes.
- NASA APOD API - Astronomy picture of the day.
- Dog API - Random dog imagery.
🛠️ Error Handling
Network requests can be unpredictable. info_fetcher.py handles potential failures smoothly: if a specific API goes down or times out, the application will simply skip that phase, alert the user of the missing module in an Errors section at the bottom of the generated sheet, and continue providing the rest of the available data.
🤝 Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check issues page.
Full Changelog: https://github.com/GiZano/traveler-api/commits/v1.0.0