def build_taxes(start, end): p = Pipeline(location=db.engine, download=False) p.get("tax_revenue") p.convert(flavor="real") p.chg_diff(period="inter") tax = p.dataset tax[[ "IRAE - Rentas de Actividades Económicas", "IRPF Cat II - Rentas de las Personas Físicas", ]] = tax[[ "IRAE - Rentas de Actividades Económicas", "IRPF Cat II - Rentas de las Personas Físicas", ]].mask(tax.index.to_series() < "2009-01-01") tax.columns = tax.columns.get_level_values(0) tax_plot = build_chart( tax, title="Recaudación impositiva", subtitle="Variación interanual", kind="line", start=start, end=end, y=[ "IRAE - Rentas de Actividades Económicas", "IRPF Cat II - Rentas de las Personas Físicas", "IVA - Valor Agregado", "Recaudación Total de la DGI", ], ) return tax_plot
def build_global_gdp(start, end): p = Pipeline(location=db.engine, download=False) p.get("global_gdp") p.chg_diff(period="inter") gdp = p.dataset[["Estados Unidos", "Unión Europea", "China"]] gdp.columns = gdp.columns.get_level_values(0) gdp_plot = build_chart( gdp, title="PBI real", subtitle="Variación interanual", kind="line", start=start, end=end, ) return gdp_plot
def build_regional_gdp(start, end): p = Pipeline(location=db.engine, download=False) p.get("regional_monthly_gdp") p.chg_diff(period="inter") gdp = p.dataset gdp.columns = gdp.columns.get_level_values(0) gdp_plot = build_chart( gdp, title="PBI mensual", subtitle="Variación interanual", kind="line", start=start, end=end, ) return gdp_plot
def build_commodity(start, end): p = Pipeline(location=db.engine, download=False) p.get("commodity_index") p.chg_diff(period="inter") commodity = p.dataset commodity.columns = commodity.columns.get_level_values(0) commodity_plot = build_chart( commodity, title="Índice de precios de commodities", subtitle="Variación interanual", kind="area", start=start, end=end, ) return commodity_plot
def build_tot(start, end): p = Pipeline(location=db.engine, download=False) p.get("terms_of_trade") p.chg_diff(period="inter") tot = p.dataset tot.columns = tot.columns.get_level_values(0) tot_plot = build_chart( tot, title="Términos de intercambio", subtitle="Variación interanual", kind="area", start=start, end=end, ) return tot_plot
def build_wages(start, end): p = Pipeline(location=db.engine, download=False) p.get("real_wages") p.chg_diff(period="inter") wages = p.dataset wages.columns = wages.columns.get_level_values(0) wages_plot = build_chart( wages, title="Salario real", subtitle="Variación interanual", kind="line", start=start, end=end, ) return wages_plot
def build_cpi(start, end): p = Pipeline(location=db.engine, download=False) p.get("cpi") p.chg_diff(period="inter") cpi = p.dataset cpi.columns = cpi.columns.get_level_values(0) cpi_plot = build_chart( cpi, title="IPC", subtitle="Variación interanual", kind="line", start=start, end=end, ) return cpi_plot
def build_industrial(start, end): p = Pipeline(location=db.engine, download=False) p.get("core_industrial") p.chg_diff(period="inter") industrial = p.dataset industrial.columns = industrial.columns.get_level_values(0) industrial_plot = build_chart( industrial, title="Producción industrial", subtitle="Variación interanual", kind="line", start=start, end=end, ) return industrial_plot
def build_gdp(start, end): p = Pipeline(location=db.engine, download=False) p.get("gdp_con_idx_sa_long") p.chg_diff(period="last") gdp = p.dataset gdp.columns = gdp.columns.get_level_values(0) gdp_plot = build_chart( gdp, title="PBI real", subtitle="Desestacionalizado, variación trimestral", kind="bar", start=start, end=end, ) return gdp_plot
def build_cpi_measures(start, end): p = Pipeline(location=db.engine, download=False) p.get("cpi_measures") p.chg_diff(period="inter") cpi_measures = p.dataset cpi_measures.columns = cpi_measures.columns.get_level_values(0) cpi_measures_plot = build_chart( cpi_measures, title="IPC transable, no transable y subyacente", subtitle="Variación interanual", kind="line", y=cpi_measures.columns[:-2], start=start, end=end, height=460, ) return cpi_measures_plot