A module for implementing convenient classes to get info from udalmap API.

class udalmap.utils.UdmDf(timeout=None)

Get Udalmap API info into Pandas dataframes.

timeout

Timeout for requests, in seconds

Type:

float, optional

find()

Provide all groups, subgroups and indicators.

Returns:

A Pandas dataframe.

Return type:

pd.DataFrame

get(indicatorId, body)

Provide an indicator’s data for a body.

Parameters:
  • indicatorId (str) – The id number of the indicator

  • body ({"entities", "regions", "municipalities"}) – The body of which to retrieve the indicator data

Returns:

A Pandas dataframe.

Return type:

pd.DataFrame

plot(indicatorId, body, filters=None)

Plot an indicator data for a body with filters.

Parameters:
  • indicatorId (str) – The id number of the indicator

  • body ({"entities", "regions", "municipalities"}) – The body of which to retrieve the indicator data

  • filters (list of str, optional) – Selects the items to plot

Return type:

Plots a Matplotlib plot.