wunderground v0.0.9 Wunderground.Query

A collections of types for handling queries to the Weather Underground API.

List of possible queries

πŸ‡ΊπŸ‡Έ Cities in the U.S.

# using state and city
{:us, "CA", "San_Francisco"}

# or via zipcode
{:us_zip, 60290}

🌍 Cities outside the U.S.

# by country and city
{:international, "Australia", "Sydney"}

🌐 Coordinates

# by latidute and longitude
{:geo, 37.8, -122.4}

✈️ Airports

# by International Civil Aviation Organization airport code
# see https://en.wikipedia.org/wiki/International_Civil_Aviation_Organization_airport_code
{:airport, "KJFK"}

🌑 Specific personal weather station

# by it's ID
{:pws, "KCASANFR70"}

πŸ“ GeoIP location

# of the running machine using
{:auto_ip}

# or of a specific IP address
{:auto_ip, {185, 1, 74, 1}}

Link to this section Summary

Types

City name as a String, where spaces should be replaced by a _

Country as a String

An IPv4 address as a tuple of 4 integers

Latitude as a float

Longitude as a float

An ID of a personal weather station as a string

US state shortform

t()

The different possible Query tuples

US zipcode as an Integer

Functions

Builds a query string for the given Query tuple

Link to this section Types

Link to this type airport_code()
airport_code() :: String.t

Shortcode of an airport. See International Civil Aviation Organization airport code.

Example

airport_code = "KJFK" # for the John F. Kennedy International Airport
Link to this type city()
city() :: String.t

City name as a String, where spaces should be replaced by a _.

Example

city = "San_Francisco"
Link to this type country()
country() :: String.t

Country as a String.

Example

country = "Australia"
Link to this type ipv4_address()
ipv4_address() :: {non_neg_integer, non_neg_integer, non_neg_integer, non_neg_integer}

An IPv4 address as a tuple of 4 integers.

Example

ipv4_address = {10, 0, 0, 23} # for 10.0.0.23
Link to this type lat()
lat() :: float

Latitude as a float.

Example

lat = 37.8
Link to this type lng()
lng() :: float

Longitude as a float.

Example

lng = -122.4
Link to this type pws_id()
pws_id() :: String.t

An ID of a personal weather station as a string.

Example

pws_id = "KCASANFR70"
Link to this type state()
state() :: String.t

US state shortform.

Example

state = "CA" # for California
Link to this type t()
t ::
  {:us, state, city} |
  {:us_zip, zipcode} |
  {:international, country, city} |
  {:geo, lat, lng} |
  {:airport, airport_code} |
  {:pws, pws_id} |
  {:auto_ip} |
  {:auto_ip, ipv4_address}

The different possible Query tuples.

Link to this type zipcode()
zipcode() :: non_neg_integer

US zipcode as an Integer.

Example

zipcode = 60290 # for Chicago, Illinois

Link to this section Functions

Builds a query string for the given Query tuple.

Isn’t really intended to be used directly. Use Wunderground.forecast/1 instead.