new_demo.mp4
Create a command-line tool that accepts a city's name and returns the weather forecast. Leverage Open Weather Map API to get the weather forecast.
- Setup a conda/pip environment using the requirements.txt file provided
- Activate the environment and cd into the project directory
- Setup a .env file in the root directory and set your OpenWeatherMap API key to the variable
OPENWEATHERMAP_API_KEY
- run main.py using
python3 main.py
- Type out the name of the required city
- If the city is amongst the hardcoded cities, it can be found in the drop-down (case sensitive, first letter should be capital). Otherwise, the full city name must be typed out to get a valid output
- Use the left and right arrow keys to navigate the calendar shown. The forecast for only the next five days will be made available.
- Use the up and down arrow keys to select the required time
- And finally, you can see the required output!!
This section lists the features and highlights the points adhering to the judging criteria of
Functionality and Completeness
.
- CLI has an autocomplete feature to get the city name.
- CLI has an interactive interface to select the date of forecast.
- CLI has an interactive interface to select the time of forecast.
- A pretty-printed output is shown in the terminal.
This section is an explanation of how we used Github copilot to speedup our process of writing code.
- Almost all of our functions were autcompleted by Github Copilot.
- To do this, we declared functions and added docstrings below them. This allowed Copilot to be able to autogenerate the rest of the code.
- A lot of pretty printing and util functions were mostly written by Github Copilot. This saves a lot of time and grunt work that would otherwise be expensive.
- Almost all of these functions have a docstring with them
- Almost every line of code has a comment preceding it, this also allowed Copilot to quickly autocomplete most lines of code (rarely requiring our intervention).
- We have followed proper variable naming conventions for Python.
- We have used interactive features in the CLI to make it look pretty and increase ease of use.
- Easy to read output for the forecast is provided with a fun looking symbol for the weather.
- Most functions return a json object containing the error message
- The main function is protected by a try-except clause that will catch the error and display the error message.
- We have tried keeping the user in mind while making the forecast tool, adding autocomplete(prev version), option of choosing dates through calendars etc to make it more user-friendly.