Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

alljames/weatherbit-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go client for Weatherbit API

Weatherbit.io provides an API that allows access to forecasts, current and historical data for locations across the world.

Weatherbit API documentation can be found here.

The API endpoints currently supported by the Go API wrapper matches the endpoints supported by the Python API wrapper.

The program has two requirements:

  • Go 1.10 or later
  • a Weatherbit API key
API key Save in api_key.txt. Requirements section provides more details
Query modify wb.Parameters - see ./examples/main.go

Example

With a Golang installation and an API key saved in the examples folder, open a terminal from the examples directory and run:

go run main.go

The Weatherbit wrapper uses strings.Builder(), provided in Go 1.10 onwards.

Design decisions

In accordance with Mat Ryer - Writing Beautiful Packages in Go, the weatherbit-go package is not asynchronous but can be used asynchronously should the user wish to do so using Golang primitives. A slice of type Parameter is recommended over a map, unless you really know what you're doing.

Documentation

Available at GoDoc

Installation

go get -u -v github.com/alljames/weatherbit-go/

To uninstall, delete the directory in your $GOPATH/src.

Requirements

Weatherbit API key - free tier option available.

Place your API Key into a file named api_key.txt (inside the same directory as the .go file where the weatherbit package is invoked). Don't forget to add api_key.txt to your .gitignore file if using a public repository. An example .gitignore file is provided in this repository.

Acknowledgments

Weatherbit.io

Contribution guide

Get involved! This package has a lot of room for improvement. Below are a list of Go features which could be used in this package to good effect.

  • Tests! Testing has significant room for improvement.

Read the docs, write and try out some improvements and then make a pull request 😄 !

Use cases

Coming soon.

About

A Golang weather API wrapper for https://www.weatherbit.io/

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages