diff --git a/README.md b/README.md index abfd9c9..87ef205 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # [yr] -Get the weather delivered to your command-line. +Get the weather delivered to your command-line, or use as a Go package. The project uses [Meteorologisk institutt]'s public API, [`LocationForecast`], and [OpenStreetMap]'s [Nominatim] API. @@ -30,6 +30,20 @@ yr forecast "new york" --web yr now "new york" --web ``` +### As a package + +```go +import "git.sr.ht/~timharek/yr/yr" + +func weather() { + y := yr.New() + + now := y.Now("bergen") + + // Use the data +} +``` + ## Contributing Anyone can contribute to [yr]. Please refer to the [contribution guidelines].