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.
|
Returns |
Docs |
|---|---|---|
|
Parsed JSON, or raw text if the response isn’t JSON |
|
|
An |
|
|
A list of raw Google Calendar API event dicts |
|
|
A |
|
|
A list of departure dicts |