Skip to content

dr-kristau/openweathercli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openweathercli

A small cli app using the openweathermap fork

Usage:

Automatic

openweathercli --loc="Los Angeles" --days 0.5 --api_key <MY_API_KEY>

Using worldcities.csv from simplemaps for latitude and longitude, and timezone.csv from timezonedb for UTC offsets, most big cities can be found automatically using only --loc and --days.

In the screenshot below the --api_key has been defined by default in the code: alt text

The wet-bulb temperature color code the text for risk, as documented in simple_wet_bulb. alt text

To count in hours rather than fractions of days, we can use:

openweathercli --loc="Los Angeles" --days=$(bc -l <<< '12/24') --api_key <MY_API_KEY>

Semi-Automatic

Given that worldcities.csv has a more extensive collection of municipalities than timezone.csv, there are a number of municipalities with no corresponding timezone, which results in output in UTC.

openweathercli --loc Girona --days 0.5 --api_key <MY_API_KEY>

In the screenshot below the --api_key has been defined by default in the code: alt text

You can resolve the timezone by specifying a value for --utc.

openweathercli --loc Girona --utc 2 --days 0.5 --api_key <MY_API_KEY>

In the screenshot below the --api_key has been defined by default in the code: alt text

Manual

openweathercli --lat 30.267222 --lon=-97.743056 --loc Austin_TX --days 0.5 --utc=-5 --api_key <MY_API_KEY>

Where:

  • --lat --lon = latitude and longitude in decimal format
  • --loc = [optional] location label
  • --days = number of decimal days between zero and five to subtract from present time
  • --utc= [optional] offset from UTC, otherwise time displayed in UTC
  • --api_key = the OpenWeather API key

In the screenshot below the --api_key has been defined by default in the code: alt text

About

A small cli app using the openweathermap fork

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages