This Streamlit application calculates the distance between two locations and provides additional insights such as traffic, weather, hotels, and restaurants using the Pathway,OPENai API,Google Maps API and OpenWeatherMap API.
- Calculate the distance and duration between two locations.
- Display the current weather at both the origin and destination.
- List nearby hotels and restaurants at both the origin and destination.
- Display a map preview of the specified locations.
- Python 3.7 or higher
- Google Cloud Platform account With Credits
- OpenWeatherMap account
-
Clone the repository:
git clone https://github.com/your-username/google-maps-enhanced-insights.git cd google-maps-enhanced-insights -
Install the required Python packages:
pip install -r requirements.txt
-
Set up API keys:
-
Create a
.envfile in the root directory of the project and add your API keys:GOOGLE_MAPS_API_KEY=your_google_maps_api_key WEATHER_API_KEY=your_weather_api_key
-
-
Run the Streamlit application:
streamlit run app.py
-
Open your web browser and go to:
http://localhost:8501 -
Enter the origin and destination locations in the provided input fields and click "Get Insights 🚗".
app.py: The main application file containing the Streamlit app code.requirements.txt: The file listing all required Python packages..env: File to store your API keys (not included in the repository).
-
Create a Google Cloud Project:
- Go to the Google Cloud Console.
- Create a new project.
-
Enable APIs:
- Enable the following APIs:
- Maps JavaScript API
- Places API
- Distance Matrix API
- Directions API
- Enable the following APIs:
-
Create API Key:
- Go to the Credentials page.
- Create a new API key and copy it.
- Add the API key to your
.envfile.
-
Create an OpenWeatherMap Account:
- Go to the OpenWeatherMap website.
- Sign up for a free account.
-
Generate API Key:
- Go to the API keys section.
- Generate a new API key and copy it.
- Add the API key to your
.envfile.
This project is licensed under the MIT License. See the LICENSE file for more details.
For any questions or suggestions, please contact [your-email@example.com].
