fmi

package module
v0.0.0-...-933bd10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2025 License: MIT Imports: 14 Imported by: 1

README

FMI

Go Report Card

Tämä Go-kirjasto hakee Ilmatieteen laitoksen rajapintojen kautta viimeisimmät säähavainnot halutulle paikalle. Hyödyllinen esimerkiksi IRC-bottia varten.

Käyttö

import (
    "fmt"

    "github.com/kari/fmi"
)

func main() {
  if weather, err := fmi.Weather("Turku"); err == nil {
    fmt.Println(weather)
  }
    // Viimeisimmät säähavainnot paikassa Turku: lämpötila 18.5°C, puolipilvistä, heikkoa länsituulta 4 m/s (6 m/s), ilmankosteus 56%
}

Katso examples/ -kansiosta lisää esimerkkejä.

Lähteet

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Open data from FMI used under Creative Commons Attribution 4.0 International license

Documentation

Overview

Package fmi fetches latest weather observations for a given place using FMI's open API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Humidex

func Humidex(t float64, td float64) float64

Humidex calculates the humidity index given air temperature t (degC) and dew point (degC) td. For reference, see https://en.wikipedia.org/wiki/Humidex

func Weather

func Weather(place string) (string, error)

Weather returns current weather for a place as a written description

func WindChill

func WindChill(t float64, v float64) float64

WindChill calculates the wind chill effect given air temperature t (degC) and wind speed v (m/s) using a Canadian formula. The calculation works for air temperatures at or below 10C and wind speeds above 0.4 m/s. For reference see, https://fi.m.wikipedia.org/wiki/Pakkasen_purevuus#Uusi_kaava

Types

This section is empty.

Directories

Path Synopsis
cmd
weather command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL