Data sources

A data source is not an XML tag — it’s declared in a config’s sources: section (see Config format) and fetched from a template with source("name"), which calls .fetch() on it and hands the result straight to Jinja:

sources:
  weather:
    source: weather.yr
    params:
      lat: 55.64277
      lon: 13.20638
      altitude: 17
{% set forecast = source('weather').nextHour(timestamp, 8) %}
<text>{{ forecast.airTemperature }}°C</text>

Whatever .fetch() returns is whatever that source type says it returns — some are plain dicts/lists, others (calendar, weather) are small model objects with helper methods. Each page below documents both the params: a source type accepts and what .fetch() gives back.

source: name

Returns

Docs

request

Parsed JSON, or raw text if the response isn’t JSON

request

calendar.ical

An ICalendarModel wrapping a parsed ICS feed

Calendar: calendar.ical, calendar.google

calendar.google

A list of raw Google Calendar API event dicts

Calendar: calendar.ical, calendar.google

weather.yr

A WeatherForecastModel

weather.yr

transportation.trafiklab.departureBoard

A list of departure dicts

transportation.trafiklab.departureBoard