Skip to content

Go client for interacting with the OpenWeather API

License

Notifications You must be signed in to change notification settings

aculclasure/weather

Repository files navigation

Go OpenWeather API Client

Go package that provides a client for interacting with the current weather API hosted by OpenWeather. Also provides a CLI that displays basic measurements of current weather for a given location.

Setup

You will need to create an OpenWeather account and API key. See their getting started guide for help on how to do this. Once you have the API key, it should be set as the environment variable OPENWEATHER_API_KEY.

CLI Usage

Mac/Linux

$ cd cmd/weather

$  go run main.go -h
USAGE: weather [-units={standard|metric|imperial}] <location>

  -units string
        the units to use, one of: standard, metric, imperial (default "imperial")

$ OPENWEATHER_API_KEY=<YOUR-API-KEY> go run main.go --units=metric london

overcast clouds, 9.21 C, humidity 46%

Windows Powershell

PS ${env:OPENWEATHER_API_KEY}=<YOUR-API-KEY>

PS cd cmd\weather

PS go run main.go --units=metric london

overcast clouds, 9.21 C, humidity 46%

About

Go client for interacting with the OpenWeather API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages