Skip to content

Script fetches weather data from external API for selected location and date. Data is displayed in terminal or written to a csv file. Errors are saved in logging file. Script is optimised to using with crontab.

Notifications You must be signed in to change notification settings

panpusto/weather_api_script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

weather.py

usage:

weather.py [-h] [-l [LOCATION]] [-sd [START_DATE]] [-ed [END_DATE]] [-d] [-s SAVE]

optional arguments:

Args Description
-h, --help show this help message and exit
-l [LOCATION], --location [LOCATION] city name (default: Wrocław)
-sd [START_DATE], --start_date [START_DATE] start date in format: YYYY-MM-DD (default: 2023-02-05)
-ed [END_DATE], --end_date [END_DATE] end date in format: YYYY-MM-DD (optional argument)
-d, --display display weather data in terminal
-s SAVE, --save SAVE save weather data as csv file, write 'filename' after argument

for example:

  • if you want to display today's weather for default location
    • python3 weather.py -l -sd -d
  • if you want to display weather from today to selected date for selected location
    • python3 weather.py -l Cracow -sd -ed 2023-02-12 -d
  • if you want to save weather info to a file instead of displaying it
    • python3 weather.py -l Warsaw -sd 2023-02-08 -ed 2023-02-15 -s my_data

About

Script fetches weather data from external API for selected location and date. Data is displayed in terminal or written to a csv file. Errors are saved in logging file. Script is optimised to using with crontab.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages