transform.enrichment package¶
Submodules¶
transform.enrichment.add_knmi_data module¶
-
transform.enrichment.add_knmi_data.
chunk_splitter
(raw)¶ Generator to read a raw file and yield chunks that are separated by ‘empty lines’: “# ” Args:
raw : str
-
transform.enrichment.add_knmi_data.
get_day_data_dataframe
(stations, start=None, end=None, inseason=False, variables=None)¶ Get daily weather data from KNMI as a Pandas DataFrame args:
- stations : [int]
- list of KNMI station numbers
- start : datetime.datetime | str
- date (optional, default is begin of current month) can be a datetime object, or a string in format “%Y%m%d”
- end : datetime.datetime | str
- date (optional, default is today) can be a datetime object, or a string in format “%Y%m%d”
- inseason : bool (optional, default False)
- see http://www.knmi.nl/kennis-en-datacentrum/achtergrond/data-ophalen-vanuit-een-script for the full explanation
variables : list of variables to fetch (optional, default is ALL)
- Returns
- daily weather data in a Pandas DataFrame. Parts included: disclaimer, stations, legend, data
-
transform.enrichment.add_knmi_data.
get_day_data_raw
(stations, start=None, end=None, inseason=False, variables=None)¶ Get daily weather data from KNMI args:
- stations : [int]
- list of KNMI station numbers
- start : datetime.datetime | str
- date (optional, default is begin of current month) can be a datetime object, or a string in format “%Y%m%d”
- end : datetime.datetime | str
- date (optional, default is today) can be a datetime object, or a string in format “%Y%m%d”
- inseason : bool (optional, default False)
- see http://www.knmi.nl/kennis-en-datacentrum/achtergrond/data-ophalen-vanuit-een-script for the full explanation
- variables : list of variables to fetch (optional, default is ALL)
- WIND = DDVEC:FG:FHX:FHX:FX wind TEMP = TG:TN:TX:T10N temperatuur SUNR = SQ:SP:Q Zonneschijnduur en globale straling PRCP = DR:RH:EV24 neerslag en potentiële verdamping PRES = PG:PGX:PGN druk op zeeniveau VICL = VVN:VVX:NG zicht en bewolking MSTR = UG:UX:UN luchtvochtigheid
- Returns:
- raw daily weather data generated by the specified weather stations. Parts included: disclaimer, stations, legend, data
-
transform.enrichment.add_knmi_data.
main
()¶
-
transform.enrichment.add_knmi_data.
parse_dataframe
(data)¶
-
transform.enrichment.add_knmi_data.
parse_day_data
(raw)¶ Parse the raw csv response of KNMI into relevant pieces. Args:
raw : strReturns
-
transform.enrichment.add_knmi_data.
parser
()¶ Parser function to run arguments from the command line and to add description to sphinx.
transform.enrichment.add_public_events module¶
-
transform.enrichment.add_public_events.
get_event_json
()¶ parse public event data from json at amsterdam.data.nl Args:
None- Returns:
- pd.DataFrame: data frame with events in Amsterdam
-
transform.enrichment.add_public_events.
main
()¶
-
transform.enrichment.add_public_events.
parser
()¶ Parser function to run arguments from the command line and to add description to sphinx.