Skip to content
/ rivers Public

Go client library and CLI utility for reading water levels in Ireland

License

Notifications You must be signed in to change notification settings

qba73/rivers

Repository files navigation

Go Go Report Card

rivers

rivers is a Go client library and a CLI utility for reading water level and water temperature data from stations located in rivers in Ireland. The tool reads data from more than 450 sensors located in 28 rivers.

Using the Go library

Import the library using:

import "github.com/qba73/rivers" 

Creating a client

Creat a new Client object by calling rivers.NewClient():

client := rivers.NewClient()

Retrieving latest water level redings

client.GetLatestWaterLevels()

or

rivers.GetLatestWaterLevels()

A complete example program

You can see an example programs which retrieves water level data in the examples/stations folder.

Bugs and feature requests

If you find a bug in the rivers client or library, please open an issue. Similarly, if you'd like a feature added or improved, let me know via an issue.

Not all the functionality of the water level is implemented yet.

Pull requests welcome!

Using the CLI utility for reading water levels

Get readings from stations (water level in millimeters):

$ waterlevel
[...]
time: 2022-07-04 00:15:00 +0000 UTC, station: Innisconnell Pier, id: 36084, level: 1152
time: 2022-07-04 09:30:00 +0000 UTC, station: Clonconwal, id: 38001, level: 619
time: 2022-07-04 09:30:00 +0000 UTC, station: Glenties, id: 38010, level: 810
time: 2022-07-03 11:30:00 +0000 UTC, station: New Mills, id: 39001, level: 210
time: 2022-07-04 09:30:00 +0000 UTC, station: Tullyarvan, id: 39003, level: 327
[...]

Save readings to a file:

$ waterlevel > levels.txt

Disclaimer

rivers project processes Irish Public Sector Information licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0), licence provided by the Office of Public Works. Data is licensed under the Creative Commons By Attribution (CC-BY) version 4.0 license - see summary. This is in line with Irish Government PER Circular 12 of 2016 and policy on Open Data data.gov.ie.