def get_gp_breakdown_data():
    district_pg = 0
    first_page_txt = pdfp_obj.pages[0].extract_text()
    heading_txt_1 = 'GAUTENG CONFIRMED COVID-19 CASES DISTRICT BREAKDOWN'
    heading_txt_2 = 'BREAKDOWN PER DISTRICT'
    breakdown_txt = get_string_between_2_strings(first_page_txt, heading_txt_1, heading_txt_2)
    if (len(breakdown_txt) == 0):
        breakdown_txt = get_string_between_2_strings(pdfp_obj.pages[1].extract_text(), heading_txt_1, heading_txt_2)
        district_pg = 1
    if (len(breakdown_txt) == 0):
        breakdown_txt = get_string_between_2_strings(pdfp_obj.pages[1].extract_text(), '^', heading_txt_2)
        district_pg = 1
    str_list = list(filter((lambda x: (False if (x == ' ') else True)), breakdown_txt.splitlines()))
    str_body = ''.join(str_list)
    sentences = str_body.split('.')

    def find_date(text):
        return re.search('(\\d{2}|\\d{1}) [a-zA-Z]* \\d{4}', text).group(0)

    def get_nums(text, exclude_texts=['COVID-19']):
        for exclude_text in exclude_texts:
            text = text.replace(exclude_text, '')
        num_tuples = re.findall('(\\d{3}|\\d{2}|\\d{1})( \\d{3}|\\d{2}|\\d{1})*', text)
        num_list = [int((x[0] + x[1].replace(' ', ''))) for x in num_tuples]
        return num_list
    date_txt = get_string_between_2_strings(pdfp_obj.pages[0].extract_text(), heading_txt_1, '$')
    sentences = ''.join(date_txt).split('.')
    _gp_covid_stats = {'date': find_date(date_txt)}
    tmp_dict = dict(zip(['cases', 'recoveries', 'deaths'], get_nums(sentences[0])[2:]))
    _gp_covid_stats.update(tmp_dict)
    tmp_dict = dict(zip(['traced', 'de_isolated'], get_nums(sentences[1])[:2]))
    _gp_covid_stats.update(tmp_dict)
    tmp_dict = dict(zip(['hospitalised'], get_nums(sentences[2])))
    _gp_covid_stats.update(tmp_dict)
    return (district_pg, _gp_covid_stats)
def get_gp_breakdown_data():
    district_pg = 0
    first_page_txt = pdfp_obj.pages[0].extract_text()
    heading_txt_1 = 'GAUTENG CONFIRMED COVID-19 CASES DISTRICT BREAKDOWN'
    heading_txt_2 = 'BREAKDOWN PER DISTRICT'
    breakdown_txt = get_string_between_2_strings(first_page_txt, heading_txt_1, heading_txt_2)
    if (len(breakdown_txt) == 0):
        breakdown_txt = get_string_between_2_strings(pdfp_obj.pages[1].extract_text(), heading_txt_1, heading_txt_2)
        district_pg = 1
    if (len(breakdown_txt) == 0):
        breakdown_txt = get_string_between_2_strings(pdfp_obj.pages[1].extract_text(), '^', heading_txt_2)
        district_pg = 1
    str_list = list(filter((lambda x: (False if (x == ' ') else True)), breakdown_txt.splitlines()))
    str_body = .join(str_list)
    sentences = str_body.split('.')

    def find_date(text):
        return re.search('(\\d{2}|\\d{1}) [a-zA-Z]* \\d{4}', text).group(0)

    def get_nums(text, exclude_texts=['COVID-19']):
        for exclude_text in exclude_texts:
            text = text.replace(exclude_text, )
        num_tuples = re.findall('(\\d{3}|\\d{2}|\\d{1})( \\d{3}|\\d{2}|\\d{1})*', text)
        num_list = [int((x[0] + x[1].replace(' ', ))) for x in num_tuples]
        return num_list
    date_txt = get_string_between_2_strings(pdfp_obj.pages[0].extract_text(), heading_txt_1, '$')
    sentences = .join(date_txt).split('.')
    _gp_covid_stats = {'date': find_date(date_txt)}
    tmp_dict = dict(zip(['cases', 'recoveries', 'deaths'], get_nums(sentences[0])[2:]))
    _gp_covid_stats.update(tmp_dict)
    tmp_dict = dict(zip(['traced', 'de_isolated'], get_nums(sentences[1])[:2]))
    _gp_covid_stats.update(tmp_dict)
    tmp_dict = dict(zip(['hospitalised'], get_nums(sentences[2])))
    _gp_covid_stats.update(tmp_dict)
    return (district_pg, _gp_covid_stats)