Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twpayne/go-meteomatics
Package meteomatics is a client library for the Meteomatics API.
https://github.com/twpayne/go-meteomatics
go golang meteomatics meteomatics-api weather weather-api weather-forecast
Last synced: 3 months ago
JSON representation
Package meteomatics is a client library for the Meteomatics API.
- Host: GitHub
- URL: https://github.com/twpayne/go-meteomatics
- Owner: twpayne
- License: mit
- Created: 2019-06-09T20:21:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-22T00:32:10.000Z (over 2 years ago)
- Last Synced: 2024-06-19T06:56:14.005Z (7 months ago)
- Topics: go, golang, meteomatics, meteomatics-api, weather, weather-api, weather-forecast
- Language: Go
- Homepage: https://www.meteomatics.com/en/api/overview/
- Size: 42 KB
- Stars: 5
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-meteomatics
[![PkgGoDev](https://pkg.go.dev/badge/twpayne/go-meteomatics)](https://pkg.go.dev/github.com/twpayne/go-meteomatics)
[![Coverage Status](https://coveralls.io/repos/github/twpayne/go-meteomatics/badge.svg)](https://coveralls.io/github/twpayne/go-meteomatics)Package `meteomatics` implements a client for the [Meteomatics
API](https://www.meteomatics.com/en/api/overview/).## Key features
* Idomatic Go API.
* Support for CSV, JSON, and PNG requests.
* Support for all location types.
* Support for all parameters.
* Support for all time types.
* Support for `context`.
* Support for Go modules.
* Well tested.## Example
```go
func ExampleNewClient_simple() {
client := meteomatics.NewClient(
meteomatics.WithBasicAuth(
os.Getenv("METEOMATICS_USERNAME"),
os.Getenv("METEOMATICS_PASSWORD"),
),
)cr, err := client.RequestCSV(
context.Background(),
meteomatics.TimeSlice{
meteomatics.TimeNow,
meteomatics.NowOffset(1 * time.Hour),
},
meteomatics.Parameter{
Name: meteomatics.ParameterTemperature,
Level: meteomatics.LevelMeters(2),
Units: meteomatics.UnitsCelsius,
},
meteomatics.Postal{
CountryCode: "CH",
ZIPCode: "9000",
},
&meteomatics.RequestOptions{},
)
if err != nil {
fmt.Println(err)
return
}fmt.Println(cr.Parameters)
for _, row := range cr.Rows {
fmt.Println(row.ValidDate)
fmt.Println(row.Values)
}
}
```## License
MIT