Weather Mosaic is a command line tool that allows users to access weather information for different cities, change the language of weather reports, retrieve weather data through GPS functionality, view historical weather data, receive weather notifications, and use Telegram for weather queries.
To use Weather Mosaic, please follow these steps:
-
Clone the repository or download the code files.
-
Install the required dependencies by running the following command:
pip install -r requirements.txt
-
Obtain API Keys: -> OpenWeatherMap API Key: Sign up on OpenWeatherMap and get an API key.
-
Set environment variables:
- Create a .env file in the project directory.
- Add the following environment variables and replace the values with your API keys and preferences:
- Replace the placeholders with your own values.
OPENWEATHERMAP_API_KEY=your_openweathermap_api_key
- You can use Microsoft Visual Studio Code to open the directory and terminal.
-
Step 1. Install a supported version of Python on your system
-
Step 2. Install the Python extension for Visual Studio Code.
-
Select your Python interpreter by clicking on the status bar
- Weather Mosaic provides integration with Microsoft Azure services for weather notifications, GPS Location Retrieval, daily and hourly weather forecast .
Add the following environment variables also to the .env
file you created earlier:
TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_PHONE_NUMBER=your_twilio_phone_number
RECIPIENT_PHONE_NUMBER=your_recipient_phone_number
- Weather notifications will now be sent to the specified recipient phone number at the specified interval.
Weather Mosaic provides integration with Telegram for weather queries. To set up Telegram integration:
-
Create a new Telegram bot by following the instructions in the Telegram Bot documentation.
-
Obtain the bot token for your newly created Telegram bot.
-
Set the following environment variable in your .env file:
TELEGRAM_BOT_TOKEN: Your Telegram bot token.
-
Replace the placeholder with your own bot token.
- To use Weather Mosaic, open a terminal or command prompt and navigate to the project directory.
python main.py
- The dashboard provides various commands and functionalities. Type command followed by any required parameters to execute the corresponding action.
- To view the dashboard with all available commands, type
help
.
- To view weather details of a specific city, type or say
weather {city_name}
. Example:
weather Lucknow
- To change the language of weather reports, type
change language
. Follow the prompts to select the desired language.
change language
- To retrieve weather data through GPS functionality, type
enable GPS
.
enable GPS
- To view historical weather data of a place, type
historical data
. Follow the prompts to enter the city name and date.
Example:
historical data
Enter city name: London
Enter date (YYYY-MM-DD): 2023-06-01
- To receive weather notifications, type
notifications
- The notification for daily weather data will be received at 8am in your mobile phone and a desktop notification has been set for your desktop.
notifications
- To save weather data for future use, type
save data
. Follow the prompts to enter the city name and date.
Example:
save data
Enter city name: London
Enter date (YYYY-MM-DD): 2023-06-01
- View weather details of any city through graphs and visuals, type
vizualization
visualization
- To use Telegram for weather queries, type
telegram
.
telegram
- To see daily forecast, type
daily forecast
.
daily forecast
- To see hourly forecast, type
hourly forecast
.
hourly forecast
- To check if there is some extreme weather coondition at your place and what necessary precautions should be taken, type
extreme condition
.
extreme condition
-
Open Google Chrome and go to the Extensions page by entering the following URL in the address bar: chrome://extensions/
-
Enable
Developer mode
by toggling the switch in the top-right corner of the Extensions page. -
Click on the
Load unpacked
button that appears. -
Select the folder where you cloned or downloaded the Chrome extension.
-
The Chrome extension should now be loaded and visible in the Extensions page.