retrieve_data

A group of functions to retrieve data from Fingertips by indicator, profile, domain (group), or geography.

fingertips_py.retrieve_data.get_all_areas_for_all_indicators()

Returns a dictionary of all indicators and their geographical breakdowns.

Returns:

Dictionary of all indicators (ID as key) and their geographical breakdowns

fingertips_py.retrieve_data.get_all_data_for_indicators(indicators, area_type_id, parent_area_type_id=15, filter_by_area_codes=None, is_test=False)

Returns a dataframe of data for given indicators at an area.

Parameters:
  • indicators – List or integer or string of indicator IDs

  • area_type_id – ID of area type (eg. ID of General Practice is 7 etc) used in Fingertips as integer or string

  • parent_area_type_id – Area type of parent area - defaults to England value

  • filter_by_area_codes – Option to limit returned data to areas. Areas as either string or list of strings

  • is_test – Used for testing. Returns a tuple of expected return and the URL called to retrieve the data

Returns:

Dataframe of data for given indicators at an area

fingertips_py.retrieve_data.get_all_data_for_profile(profile_id, parent_area_type_id=15, area_type_id=None, filter_by_area_codes=None, is_test=False)

Returns a dataframe of data for all indicators within a profile.

Parameters:
  • profile_id – ID used in Fingertips to identify a profile as integer or string

  • parent_area_type_id – Area type of parent area - defaults to England value

  • area_type_id – Option to only return data for a given area type. Area type ids are string, int or a list.

  • filter_by_area_codes – Option to limit returned data to areas. Areas as either string or list of strings.

  • is_test – Used for testing. Returns a tuple of expected return and the URL called to retrieve the data

Returns:

A dataframe of data for all indicators within a profile with any filters applied

fingertips_py.retrieve_data.get_data_by_indicator_ids(indicator_ids, area_type_id, parent_area_type_id=15, profile_id=None, include_sortable_time_periods=None, is_test=False)

Returns a dataframe of indicator data given a list of indicators and area types. :param indicator_ids: Single indicator ID or list of indicator IDs, as integers or strings :param area_type_id: ID of area type (eg. CCG, Upper Tier Local Authority) used in Fingertips as integer or string :param parent_area_type_id: Area type of parent area - defaults to England value :param profile_id: ID of profile to select by as either int or string :param include_sortable_time_periods: Boolean as to whether to include a sort-friendly data field :param is_test: Used for testing. Returns a tuple of expected return and the URL called to retrieve the data :return: A dataframe of data relating to the given indicators

fingertips_py.retrieve_data.get_data_for_indicator_at_all_available_geographies(indicator_id)

Returns a dataframe of all data for an indicator for all available geographies.

Parameters:

indicator_id – Indicator id

Returns:

Dataframe of data for indicator for all available areas for all time periods