airpyllution.utils

Module Contents

Functions

convert_unix_to_date(utime)

Returns formatted date time string

convert_data_to_pandas(raw_data)

Converts API data from OpenWeatherMap to a pandas dataframe

airpyllution.utils.convert_unix_to_date(utime)[source]

Returns formatted date time string

Given a UNIX timestamp, this function reformats the timestamp to a string

Parameters

utime (int) – UNIX timestamp, e.g. 1606488670

Return type

datetime

Examples

>>> date_conversion(1606488670)
2020-11-27 17:00:00
airpyllution.utils.convert_data_to_pandas(raw_data)[source]

Converts API data from OpenWeatherMap to a pandas dataframe

Parses the JSON data object and transforms it to a dataframe with a formatted date column

Parameters

raw_data (JSON object) –

Return type

Pandas.dataframe

Examples

>>> convert_data_to_pandas(data)