From e210cb771d85ac78bdccb667d4e16af68d95500c Mon Sep 17 00:00:00 2001 From: skelt0 <16990151+skelt0@users.noreply.github.com> Date: Wed, 20 Dec 2023 22:44:10 +0000 Subject: [PATCH 1/2] feat: Initial Test Commit for Gedling Borough Council --- .../councils/GedlingBoroughCouncil.py | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 uk_bin_collection/uk_bin_collection/councils/GedlingBoroughCouncil.py diff --git a/uk_bin_collection/uk_bin_collection/councils/GedlingBoroughCouncil.py b/uk_bin_collection/uk_bin_collection/councils/GedlingBoroughCouncil.py new file mode 100644 index 0000000000..2991cbdb5b --- /dev/null +++ b/uk_bin_collection/uk_bin_collection/councils/GedlingBoroughCouncil.py @@ -0,0 +1,106 @@ +from bs4 import BeautifulSoup +import requests, os + +from uk_bin_collection.uk_bin_collection.common import * +from uk_bin_collection.uk_bin_collection.get_bin_data import \ + AbstractGetBinDataClass + + +# import the wonderful Beautiful Soup and the URL grabber +class CouncilClass(AbstractGetBinDataClass): + """ + Concrete classes have to implement all abstract operations of the + base class. They can also override some operations with a default + implementation. + """ + + def parse_data(self, page: str, **kwargs) -> dict: + # Make a BS4 object + + data = {"bins": []} + + user_agent = ( + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) " + "Chrome/108.0.0.0 Safari/537.36" + ) + headers = {"User-Agent": user_agent} + + address_street = "Valeside Gardens" + + # Stage 1 - Fetch initial page to get hidden form values needed for submission + stage1_url = "https://apps.gedling.gov.uk/refuse/search.aspx" + stage1_data = requests.get("https://apps.gedling.gov.uk/refuse/search.aspx", headers=headers) + + soup = BeautifulSoup(stage1_data.text, features="html.parser") + try: + value_viewstate = soup.find_all("input", {"id": "__VIEWSTATE"})[0]['value'] + value_viewstategenerator = soup.find_all("input", {"id": "__VIEWSTATEGENERATOR"})[0]['value'] + value_eventvalidation = soup.find_all("input", {"id": "__EVENTVALIDATION"})[0]['value'] + except: + raise Exception("Beautiful Soup was not able to get the data back from the Stage 1 URL that we were expecting. Please raise an issue in GitHub") + + # Stage 2 - Now POST the query to get the bin data back + stage2_url = "https://apps.gedling.gov.uk/refuse/search.aspx" + post_data = { + "__VIEWSTATE":value_viewstate, + "__VIEWSTATEGENERATOR":value_viewstategenerator, + "__EVENTVALIDATION":value_eventvalidation, + "ctl00$MainContent$street":address_street, + "ctl00$MainContent$mybutton":"Search" + } + + stage2_request = requests.post(stage2_url,data=post_data,headers=headers) + + soup = BeautifulSoup(stage2_request.text, features="html.parser") + + bin_refuse_calendar = os.path.basename(soup.find_all('a', {"id": "ctl00_MainContent_streetgridview_ctl02_calendar1"})[0]['href']) + bin_garden_calendar = os.path.basename(soup.find_all('a', {"id": "ctl00_MainContent_gardenGridView_ctl02_calendar2"})[0]['href']) + + bin_data = self.get_manual_data("refuse",bin_refuse_calendar) + + for k,v in bin_data.items(): + for date in v: + + dict_data = { + "type": k, + "collectionDate": date + } + + data["bins"].append(dict_data) + + return data + + def get_manual_data(self,type,calendar): + # Function to hold all the manual bin data extracted from the PDF's + + raw_data = { + 'refuse':{ + 'FridayG1-2024.pdf':{ + 'Black Bin': ['08/12/2023', '22/12/2023', '05/01/2024', '19/01/2024', '02/02/2024', '16/02/2024', '01/03/2024', '15/03/2024', '29/03/2024', '12/04/2024', '26/04/2024', '10/05/2024', '24/05/2024', '07/06/2024', '21/06/2024', '05/07/2024', '19/07/2024', '02/08/2024', '16/08/2024', '30/08/2024', '13/09/2024', '27/09/2024', '11/10/2024', '25/10/2024', '08/11/2024', '22/11/2024'], + 'Green Bin': ['01/12/2023', '15/12/2023', '29/12/2023', '12/01/2024', '26/01/2024', '09/02/2024', '23/02/2024', '08/03/2024', '22/03/2024', '05/04/2024', '19/04/2024', '03/05/2024', '17/05/2024', '31/05/2024', '14/06/2024', '28/06/2024', '12/07/2024', '26/07/2024', '09/08/2024', '23/08/2024', '06/09/2024', '20/09/2024', '04/10/2024', '18/10/2024', '01/11/2024', '15/11/2024', '29/11/2024'], + 'Glass Box': ['01/12/2023', '29/12/2023', '26/01/2024', '23/02/2024', '22/03/2024', '19/04/2024', '17/05/2024', '14/06/2024', '12/07/2024', '09/08/2024', '06/09/2024', '04/10/2024', '01/11/2024', '29/11/2024'] + }, + 'FridayG2-2024.pdf':{ + 'Black Bin': ['01/12/2023', '15/12/2023', '29/12/2023', '12/01/2024', '26/01/2024', '09/02/2024', '23/02/2024', '08/03/2024', '22/03/2024', '05/04/2024', '19/04/2024', '03/05/2024', '17/05/2024', '31/05/2024', '14/06/2024', '28/06/2024', '12/07/2024', '26/07/2024', '09/08/2024', '23/08/2024', '06/09/2024', '20/09/2024', '04/10/2024', '18/10/2024', '01/11/2024', '15/11/2024', '29/11/2024'], + 'Green Bin': ['08/12/2023', '21/12/2023', '05/01/2024', '19/01/2024', '02/02/2024', '16/02/2024', '01/03/2024', '15/03/2024', '29/03/2024', '12/04/2024', '26/04/2024', '10/05/2024', '24/05/2024', '07/06/2024', '21/06/2024', '05/07/2024', '19/07/2024', '02/08/2024', '16/08/2024', '30/08/2024', '13/09/2024', '27/09/2024', '11/10/2024', '25/10/2024', '08/11/2024', '22/11/2024'], + 'Glass Box': ['08/12/2023', '05/01/2024', '02/02/2024', '01/03/2024', '29/03/2024', '26/04/2024', '24/05/2024', '21/06/2024', '19/07/2024', '16/08/2024', '13/09/2024', '11/10/2024', '08/11/2024'] + }, + 'FridayG3-2024.pdf':{ + 'Black Bin': ['08/12/2023', '21/12/2023', '05/01/2024', '19/01/2024', '02/02/2024', '16/02/2024', '01/03/2024', '15/03/2024', '29/03/2024', '12/04/2024', '26/04/2024', '10/05/2024', '24/05/2024', '07/06/2024', '21/06/2024', '05/07/2024', '19/07/2024', '02/08/2024', '16/08/2024', '30/08/2024', '13/09/2024', '27/09/2024', '11/10/2024', '25/10/2024', '08/11/2024', '22/11/2024'], + 'Green Bin': ['01/12/2023', '15/12/2023', '29/12/2023', '12/01/2024', '26/01/2024', '09/02/2024', '23/02/2024', '08/03/2024', '22/03/2024', '05/04/2024', '19/04/2024', '03/05/2024', '17/05/2024', '31/05/2024', '14/06/2024', '28/06/2024', '12/07/2024', '26/07/2024', '09/08/2024', '23/08/2024', '06/09/2024', '20/09/2024', '04/10/2024', '18/10/2024', '01/11/2024', '15/11/2024', '29/11/2024'], + 'Glass Box': ['15/12/2023', '12/01/2024', '09/02/2024', '08/03/2024', '05/04/2024', '03/05/2024', '31/05/2024', '28/06/2024', '26/07/2024', '23/08/2024', '20/09/2024', '18/10/2024', '15/11/2024'] + }, + 'FridayG4-2024.pdf':{ + 'Black Bin': ['01/12/2023', '15/12/2023', '29/12/2023', '12/01/2024', '26/01/2024', '09/02/2024', '23/02/2024', '08/03/2024', '22/03/2024', '05/04/2024', '19/04/2024', '03/05/2024', '17/05/2024', '31/05/2024', '14/06/2024', '28/06/2024', '12/07/2024', '26/07/2024', '09/08/2024', '23/08/2024', '06/09/2024', '20/09/2024', '04/10/2024', '18/10/2024', '01/11/2024', '15/11/2024', '29/11/2024'], + 'Green Bin': ['08/12/2023', '21/12/2023', '05/01/2024', '19/01/2024', '02/02/2024', '16/02/2024', '01/03/2024', '15/03/2024', '29/03/2024', '12/04/2024', '26/04/2024', '10/05/2024', '24/05/2024', '07/06/2024', '21/06/2024', '05/07/2024', '19/07/2024', '02/08/2024', '16/08/2024', '30/08/2024', '13/09/2024', '27/09/2024', '11/10/2024', '25/10/2024', '08/11/2024', '22/11/2024'], + 'Glass Box': ['21/12/2023', '19/01/2024', '16/02/2024', '15/03/2024', '12/04/2024', '10/05/2024', '07/06/2024', '05/07/2024', '02/08/2024', '30/08/2024', '27/09/2024', '25/10/2024', '22/11/2024'] + } + }, + 'green': { + + } + } + + return raw_data[type][calendar] + + From e1d3f7662562de5dd4be2c26c001073243525a7b Mon Sep 17 00:00:00 2001 From: skelt0 <16990151+skelt0@users.noreply.github.com> Date: Wed, 27 Dec 2023 22:09:53 +0000 Subject: [PATCH 2/2] feat: Adding support for Gedling Borough Council --- .../features/validate_council_outputs.feature | 1 + uk_bin_collection/tests/input.json | 11 +- .../councils/GedlingBoroughCouncil.py | 132 ++++++++++++++++-- 3 files changed, 134 insertions(+), 10 deletions(-) diff --git a/uk_bin_collection/tests/features/validate_council_outputs.feature b/uk_bin_collection/tests/features/validate_council_outputs.feature index ba2649e274..18020726c3 100644 --- a/uk_bin_collection/tests/features/validate_council_outputs.feature +++ b/uk_bin_collection/tests/features/validate_council_outputs.feature @@ -47,6 +47,7 @@ Feature: Test each council output matches expected results | FenlandDistrictCouncil | None | None | | ForestOfDeanDistrictCouncil | http://selenium:4444 | local | | GatesheadCouncil | http://selenium:4444 | local | + | GedlingBoroughCouncil | None | None | | GlasgowCityCouncil | None | None | | GuildfordCouncil | None | None | | HaltonBoroughCouncil | http://selenium:4444 | local | diff --git a/uk_bin_collection/tests/input.json b/uk_bin_collection/tests/input.json index fbaae5d688..48816f6874 100644 --- a/uk_bin_collection/tests/input.json +++ b/uk_bin_collection/tests/input.json @@ -223,7 +223,7 @@ }, "EastRidingCouncil": { "postcode": "HU17 8LG", - "house_number":"14 THE LEASES BEVERLEY HU17 8LG", + "house_number": "14 THE LEASES BEVERLEY HU17 8LG", "skip_get_url": true, "web_driver": "http://selenium:4444", "url": "https://wasterecyclingapi.eastriding.gov.uk", @@ -281,6 +281,13 @@ "wiki_name": "Gateshead Council", "wiki_note": "Pass the house name/number in the house number parameter, wrapped in double quotes" }, + "GedlingBoroughCouncil": { + "house_number": "Valeside Gardens", + "skip_get_url": true, + "url": "https://www.gedling.gov.uk/", + "wiki_name": "Gedling Borough Council", + "wiki_note": "Pass the street name into the -n parameter. Use [this](https://apps.gedling.gov.uk/refuse/search.aspx) to help work out a street search that is unique. Known issues: 1) If multiple streets returned, it will pick the first and these may have different bin schedules. 2) This data is hand entered as council only provide non-parseable non-accessible PDFs - Please double check for any issues. 2b) Data is only included until end of Nov 2024 (refuse) and March 2024 (Garden). Data will need to be updated by hand after these dates." + }, "GlasgowCityCouncil": { "url": "https://www.glasgow.gov.uk/forms/refuseandrecyclingcalendar/PrintCalendar.aspx?UPRN=906700034497", "wiki_command_url_override": "https://www.glasgow.gov.uk/forms/refuseandrecyclingcalendar/PrintCalendar.aspx?UPRN=XXXXXXXX", @@ -830,4 +837,4 @@ "url": "https://waste-api.york.gov.uk/api/Collections/GetBinCollectionDataForUprn/", "wiki_name": "York Council" } -} +} \ No newline at end of file diff --git a/uk_bin_collection/uk_bin_collection/councils/GedlingBoroughCouncil.py b/uk_bin_collection/uk_bin_collection/councils/GedlingBoroughCouncil.py index 2991cbdb5b..e6b93c69cb 100644 --- a/uk_bin_collection/uk_bin_collection/councils/GedlingBoroughCouncil.py +++ b/uk_bin_collection/uk_bin_collection/councils/GedlingBoroughCouncil.py @@ -25,7 +25,7 @@ def parse_data(self, page: str, **kwargs) -> dict: ) headers = {"User-Agent": user_agent} - address_street = "Valeside Gardens" + address_street = kwargs.get("paon") # Stage 1 - Fetch initial page to get hidden form values needed for submission stage1_url = "https://apps.gedling.gov.uk/refuse/search.aspx" @@ -52,11 +52,14 @@ def parse_data(self, page: str, **kwargs) -> dict: stage2_request = requests.post(stage2_url,data=post_data,headers=headers) soup = BeautifulSoup(stage2_request.text, features="html.parser") + try: + bin_refuse_calendar = os.path.basename(soup.find_all('a', {"id": "ctl00_MainContent_streetgridview_ctl02_calendar1"})[0]['href']) + bin_garden_calendar = os.path.basename(soup.find_all('a', {"id": "ctl00_MainContent_gardenGridView_ctl02_calendar2"})[0]['href']) + except: + raise Exception("No results for address lookup found. If correct address is being used, please raise a GitHub issue") + - bin_refuse_calendar = os.path.basename(soup.find_all('a', {"id": "ctl00_MainContent_streetgridview_ctl02_calendar1"})[0]['href']) - bin_garden_calendar = os.path.basename(soup.find_all('a', {"id": "ctl00_MainContent_gardenGridView_ctl02_calendar2"})[0]['href']) - - bin_data = self.get_manual_data("refuse",bin_refuse_calendar) + bin_data = self.get_manual_data(bin_refuse_calendar, bin_garden_calendar) for k,v in bin_data.items(): for date in v: @@ -70,11 +73,91 @@ def parse_data(self, page: str, **kwargs) -> dict: return data - def get_manual_data(self,type,calendar): + def get_manual_data(self,refuse,garden): # Function to hold all the manual bin data extracted from the PDF's raw_data = { 'refuse':{ + 'MondayG1-2024.pdf':{ + 'Black Bin':['04/12/2023', '16/12/2023', '30/12/2023', '15/01/2024', '29/01/2024', '12/02/2024', '26/02/2024', '11/03/2024', '25/03/2024', '08/04/2024', '22/04/2024', '04/05/2024', '20/05/2024', '03/06/2024', '17/06/2024', '01/07/2024', '15/07/2024', '29/07/2024', '12/08/2024', '24/08/2024', '09/09/2024', '23/09/2024', '07/10/2024', '21/10/2024', '04/11/2024', '18/11/2024'], + 'Green Bin':['11/12/2023', '22/12/2023', '08/01/2024', '22/01/2024', '05/02/2024', '19/02/2024', '04/03/2024', '18/03/2024', '30/03/2024', '15/04/2024', '29/04/2024', '13/05/2024', '25/05/2024', '10/06/2024', '24/06/2024', '08/07/2024', '22/07/2024', '05/08/2024', '19/08/2024', '02/09/2024', '16/09/2024', '30/09/2024', '14/10/2024', '28/10/2024', '11/11/2024', '25/11/2024'], + 'Glass Box':['27/11/2023', '22/12/2023', '22/01/2024', '19/02/2024', '18/03/2024', '15/04/2024', '13/05/2024', '10/06/2024', '08/07/2024', '05/08/2024', '02/09/2024', '30/09/2024', '28/10/2024', '25/11/2024'] + }, + 'MondayG2-2024.pdf':{ + 'Black Bin':['11/12/2023', '22/12/2023', '08/01/2024', '22/01/2024', '05/02/2024', '19/02/2024', '04/03/2024', '18/03/2024', '30/03/2024', '15/04/2024', '29/04/2024', '13/05/2024', '25/05/2024', '10/06/2024', '24/06/2024', '08/07/2024', '22/07/2024', '05/08/2024', '19/08/2024', '02/09/2024', '16/09/2024', '30/09/2024', '14/10/2024', '28/10/2024', '11/11/2024', '25/11/2024'], + 'Green Bin':['04/12/2023', '16/12/2023', '30/12/2024', '15/01/2024', '29/01/2024', '12/02/2024', '26/02/2024', '11/03/2024', '25/03/2024', '08/04/2024', '22/04/2024', '04/05/2024', '20/05/2024', '03/06/2024', '17/06/2024', '01/07/2024', '15/07/2024', '29/07/2024', '12/08/2024', '24/08/2024', '09/09/2024', '23/09/2024', '07/10/2024', '21/10/2024', '04/11/2024', '18/11/2024'], + 'Glass Box':['04/12/2023', '30/12/2023', '29/01/2024', '26/02/2024', '25/03/2024', '22/04/2024', '20/05/2024', '17/06/2024', '15/07/2024', '12/08/2024', '09/09/2024', '07/10/2024', '04/11/2024'] + }, + 'MondayG3-2024.pdf':{ + 'Black Bin':['04/12/2023', '16/12/2023', '30/12/2023', '15/01/2024', '29/01/2024', '12/02/2024', '26/02/2024', '11/03/2024', '25/03/2024', '08/04/2024', '22/04/2024', '04/05/2024', '20/05/2024', '03/06/2024', '17/06/2024', '01/07/2024', '15/07/2024', '29/07/2024', '12/08/2024', '24/08/2024', '09/09/2024', '23/09/2024', '07/10/2024', '21/10/2024', '04/11/2024', '18/11/2024'], + 'Green Bin':['11/12/2023', '22/12/2023', '08/01/2024', '22/01/2024', '05/02/2024', '19/02/2024', '04/03/2024', '18/03/2024', '30/03/2024', '15/04/2024', '29/04/2024', '13/05/2024', '25/05/2024', '10/06/2024', '24/06/2024', '08/07/2024', '22/07/2024', '05/08/2024', '19/08/2024', '02/09/2024', '16/09/2024', '30/09/2024', '14/10/2024', '28/10/2024', '11/11/2024', '25/11/2024'], + 'Glass Box':['11/12/2023', '08/01/2024', '05/02/2024', '04/03/2024', '30/03/2024', '29/04/2024', '25/05/2024', '24/06/2024', '22/07/2024', '19/08/2024', '16/09/2024', '14/10/2024', '11/11/2024'] + }, + 'MondayG4-2024.pdf':{ + 'Black Bin':['11/12/2023', '22/12/2023', '08/01/2024', '22/01/2024', '05/02/2024', '19/02/2024', '04/03/2024', '18/03/2024', '30/03/2024', '15/04/2024', '29/04/2024', '13/05/2024', '25/05/2024', '10/06/2024', '24/06/2024', '08/07/2024', '22/07/2024', '05/08/2024', '19/08/2024', '02/09/2024', '16/09/2024', '30/09/2024', '14/10/2024', '28/10/2024', '11/11/2024', '25/11/2024'], + 'Green Bin':['04/12/2023', '16/12/2023', '30/12/2023', '15/01/2024', '29/01/2024', '12/02/2024', '26/02/2024', '11/03/2024', '25/03/2024', '08/04/2024', '22/04/2024', '04/05/2024', '20/05/2024', '03/06/2024', '17/06/2024', '01/07/2024', '15/07/2024', '29/07/2024', '12/08/2024', '24/08/2024', '09/09/2024', '23/09/2024', '07/10/2024', '21/10/2024', '04/11/2024', '18/11/2024'], + 'Glass Box':['16/12/2023', '15/01/2024', '12/02/2024', '11/03/2024', '08/04/2024', '04/05/2024', '03/06/2024', '01/07/2024', '29/07/2024', '24/08/2024', '23/09/2024', '21/10/2024', '18/11/2024'] + }, + 'TuesdayG1-2024.pdf':{ + 'Black Bin':['05/12/2023', '18/12/2023', '02/01/2024', '16/01/2024', '30/01/2024', '13/02/2024', '27/02/2024', '12/03/2024', '26/03/2024', '09/04/2024', '23/04/2024', '07/05/2024', '21/05/2024', '04/06/2024', '18/06/2024', '02/07/2024', '16/07/2024', '30/07/2024', '13/08/2024', '27/08/2024', '10/09/2024', '24/09/2024', '08/10/2024', '22/10/2024', '05/11/2024', '19/11/2024'], + 'Green Bin':['12/12/2023', '26/12/2023', '09/01/2024', '23/01/2024', '06/02/2024', '20/02/2024', '05/03/2024', '19/03/2024', '02/04/2024', '16/04/2024', '30/04/2024', '14/05/2024', '28/05/2024', '11/06/2024', '25/06/2024', '09/07/2024', '23/07/2024', '06/08/2024', '20/08/2024', '03/09/2024', '17/09/2024', '01/10/2024', '15/10/2024', '29/10/2024', '12/11/2024', '26/11/2024'], + 'Glass Box':['23/12/2023', '23/01/2024', '20/02/2024', '19/03/2024', '16/04/2024', '14/05/2024', '11/06/2024', '09/07/2024', '06/08/2024', '03/09/2024', '01/10/2024', '29/10/2024', '26/11/2024'] + }, + 'TuesdayG2-2024.pdf':{ + 'Black Bin':['12/12/2023', '23/12/2023', '09/01/2024', '23/01/2024', '06/02/2024', '20/02/2024', '05/03/2024', '19/03/2024', '02/04/2024', '16/04/2024', '30/04/2024', '14/05/2024', '28/05/2024', '11/06/2024', '25/06/2024', '09/07/2024', '23/07/2024', '06/08/2024', '20/08/2024', '03/09/2024', '17/09/2024', '01/10/2024', '15/10/2024', '29/10/2024', '12/11/2024', '26/11/2024'], + 'Green Bin':['05/12/2023', '18/12/2023', '02/01/2024', '16/01/2024', '30/01/2024', '13/02/2024', '27/02/2024', '12/03/2024', '26/03/2024', '09/04/2024', '23/04/2024', '07/05/2024', '21/05/2024', '04/06/2024', '18/06/2024', '02/07/2024', '16/07/2024', '30/07/2024', '13/08/2024', '27/08/2024', '10/09/2024', '24/09/2024', '08/10/2024', '22/10/2024', '05/11/2024', '19/11/2024'], + 'Glass Box':['05/12/2023', '02/01/2024', '30/01/2024', '27/02/2024', '26/03/2024', '23/04/2024', '21/05/2024', '18/06/2024', '16/07/2024', '13/08/2024', '10/09/2024', '08/10/2024', '05/11/2024'] + }, + 'TuesdayG3-2024.pdf':{ + 'Black Bin':['05/12/2023', '18/12/2023', '02/01/2024', '16/01/2024', '30/01/2024', '13/02/2024', '27/02/2024', '12/03/2024', '26/03/2024', '09/04/2024', '23/04/2024', '07/05/2024', '21/05/2024', '04/06/2024', '18/06/2024', '02/07/2024', '16/07/2024', '30/07/2024', '13/08/2024', '27/08/2024', '10/09/2024', '24/09/2024', '08/10/2024', '22/10/2024', '05/11/2024', '19/11/2024'], + 'Green Bin':['12/12/2023', '23/12/2023', '09/01/2024', '23/01/2024', '06/02/2024', '20/02/2024', '05/03/2024', '19/03/2024', '02/04/2024', '16/04/2024', '30/04/2024', '14/05/2024', '28/05/2024', '11/06/2024', '25/06/2024', '09/07/2024', '23/07/2024', '06/08/2024', '20/08/2024', '03/09/2024', '17/09/2024', '01/10/2024', '15/10/2024', '29/10/2024', '12/11/2024', '26/11/2024'], + 'Glass Box':['12/12/2023', '09/01/2024', '06/02/2024', '05/03/2024', '02/04/2024', '30/04/2024', '28/05/2024', '25/06/2024', '23/07/2024', '20/08/2024', '17/09/2024', '15/10/2024', '12/11/2024'] + }, + 'TuesdayG4-2024.pdf':{ + 'Black Bin':['12/12/2023', '23/12/2023', '09/01/2024', '23/01/2024', '06/02/2024', '20/02/2024', '05/03/2024', '19/03/2024', '02/04/2024', '16/04/2024', '30/04/2024', '14/05/2024', '28/05/2024', '11/06/2024', '25/06/2024', '09/07/2024', '23/07/2024', '06/08/2024', '20/08/2024', '03/09/2024', '17/09/2024', '01/10/2024', '15/10/2024', '29/10/2024', '12/11/2024', '26/11/2024'], + 'Green Bin':['05/12/2023', '18/12/2023', '02/01/2024', '16/01/2024', '30/01/2024', '13/02/2024', '27/02/2024', '12/03/2024', '26/03/2024', '09/04/2024', '23/04/2024', '07/05/2024', '21/05/2024', '04/06/2024', '18/06/2024', '02/07/2024', '16/07/2024', '30/07/2024', '13/08/2024', '27/08/2024', '10/09/2024', '24/09/2024', '08/10/2024', '22/10/2024', '05/11/2024', '19/11/2024'], + 'Glass Box':['18/12/2023', '16/01/2024', '13/02/2024', '12/03/2024', '09/04/2024', '07/05/2024', '04/06/2024', '02/07/2024', '30/07/2024', '27/08/2024', '24/09/2024', '22/10/2024', '19/11/2024'] + }, + 'WednesdayG1-2024.pdf':{ + 'Black Bin':['06/12/2023', '19/12/2023', '03/01/2024', '17/01/2024', '31/01/2024', '14/02/2024', '28/02/2024', '13/03/2024', '27/03/2024', '10/04/2024', '24/04/2024', '08/05/2024', '22/05/2024', '05/06/2024', '19/06/2024', '03/07/2024', '17/07/2024', '31/07/2024', '14/08/2024', '28/08/2024', '11/09/2024', '25/09/2024', '09/10/2024', '23/10/2024', '06/11/2024', '20/11/2024'], + 'Green Bin':['13/12/2023', '27/12/2023', '10/01/2024', '24/01/2024', '07/02/2024', '21/02/2024', '06/03/2024', '20/03/2024', '03/04/2024', '17/04/2024', '01/05/2024', '15/05/2024', '29/05/2024', '12/06/2024', '26/06/2024', '10/07/2024', '24/07/2024', '07/08/2024', '21/08/2024', '04/09/2024', '18/09/2024', '02/10/2024', '16/10/2024', '30/10/2024', '13/11/2024', '27/11/2024'], + 'Glass Box':['27/12/2023', '24/01/2024', '21/02/2024', '20/03/2024', '17/04/2024', '15/05/2024', '12/06/2024', '10/07/2024', '07/08/2024', '04/09/2024', '02/10/2024', '30/10/2024', '27/11/2024'] + }, + 'WednesdayG2-2024.pdf':{ + 'Black Bin':['13/12/2023', '27/12/2023', '10/01/2024', '24/01/2024', '07/02/2024', '21/02/2024', '06/03/2024', '20/03/2024', '03/04/2024', '17/04/2024', '01/05/2024', '15/05/2024', '29/05/2024', '12/06/2024', '26/06/2024', '10/07/2024', '24/07/2024', '07/08/2024', '21/08/2024', '04/09/2024', '18/09/2024', '02/10/2024', '16/10/2024', '30/10/2024', '13/11/2024', '27/11/2024'], + 'Green Bin':['06/12/2023', '19/12/2023', '03/01/2024', '17/01/2024', '31/01/2024', '14/02/2024', '28/02/2024', '13/03/2024', '27/03/2024', '10/04/2024', '24/04/2024', '08/05/2024', '22/05/2024', '05/06/2024', '19/06/2024', '03/07/2024', '17/07/2024', '31/07/2024', '14/08/2024', '28/08/2024', '11/09/2024', '25/09/2024', '09/10/2024', '23/10/2024', '06/11/2024', '20/11/2024'], + 'Glass Box':['06/12/2023', '03/01/2024', '31/01/2024', '28/02/2024', '27/03/2024', '24/04/2024', '22/05/2024', '19/06/2024', '17/07/2024', '14/08/2024', '11/09/2024', '09/10/2024', '06/11/2024'] + }, + 'WednesdayG3-2024.pdf':{ + 'Black Bin':['06/12/2023', '19/12/2023', '03/01/2024', '17/01/2024', '31/01/2024', '14/02/2024', '28/02/2024', '13/03/2024', '27/03/2024', '10/04/2024', '24/04/2024', '08/05/2024', '22/05/2024', '05/06/2024', '19/06/2024', '03/07/2024', '17/07/2024', '31/07/2024', '14/08/2024', '28/08/2024', '11/09/2024', '25/09/2024', '09/10/2024', '23/10/2024', '06/11/2024', '20/11/2024'], + 'Green Bin':['13/12/2023', '27/12/2023', '10/01/2024', '24/01/2024', '07/02/2024', '21/02/2024', '06/03/2024', '20/03/2024', '03/04/2024', '17/04/2024', '01/05/2024', '15/05/2024', '29/05/2024', '12/06/2024', '26/06/2024', '10/07/2024', '24/07/2024', '07/08/2024', '21/08/2024', '04/09/2024', '18/09/2024', '02/10/2024', '16/10/2024', '30/10/2024', '13/11/2024', '27/11/2024'], + 'Glass Box':['13/12/2023', '10/01/2024', '07/02/2024', '06/03/2024', '03/04/2024', '01/05/2024', '29/05/2024', '26/06/2024', '24/07/2024', '21/08/2024', '18/09/2024', '16/10/2024', '13/11/2024'] + }, + 'WednesdayG4-2024.pdf':{ + 'Black Bin':['13/12/2023', '27/12/2023', '10/01/2024', '24/01/2024', '07/02/2024', '21/02/2024', '06/03/2024', '20/03/2024', '03/04/2024', '17/04/2024', '01/05/2024', '15/05/2024', '29/05/2024', '12/06/2024', '26/06/2024', '10/07/2024', '24/07/2024', '07/08/2024', '21/08/2024', '04/09/2024', '18/09/2024', '02/10/2024', '16/10/2024', '30/10/2024', '13/11/2024', '27/11/2024'], + 'Green Bin':['06/12/2023', '19/12/2023', '03/01/2024', '17/01/2024', '31/01/2024', '14/02/2024', '28/02/2024', '13/03/2024', '27/03/2024', '10/04/2024', '24/04/2024', '08/05/2024', '22/05/2024', '05/06/2024', '19/06/2024', '03/07/2024', '17/07/2024', '31/07/2024', '14/08/2024', '28/08/2024', '11/09/2024', '25/09/2024', '09/10/2024', '23/10/2024', '06/11/2024', '20/11/2024'], + 'Glass Box':['19/12/2023', '17/01/2024', '14/02/2024', '13/03/2024', '10/04/2024', '08/05/2024', '05/06/2024', '03/07/2024', '31/07/2024', '28/08/2024', '25/09/2024', '23/10/2024', '20/11/2024'] + }, + 'ThursdayG1-2024.pdf':{ + 'Black Bin':['07/12/2023', '20/12/2023', '04/01/2024', '18/01/2024', '01/02/2024', '15/02/2024', '29/02/2024', '14/03/2024', '28/03/2024', '11/04/2024', '25/04/2024', '09/05/2024', '23/05/2024', '06/06/2024', '20/06/2024', '04/07/2024', '18/07/2024', '01/08/2024', '15/08/2024', '29/08/2024', '12/09/2024', '26/09/2024', '10/10/2024', '24/10/2024', '07/11/2024', '21/11/2024'], + 'Green Bin':['14/12/2023', '28/12/2023', '11/01/2024', '25/01/2024', '08/02/2024', '22/02/2024', '07/03/2024', '21/03/2024', '04/04/2024', '18/04/2024', '02/05/2024', '16/05/2024', '30/05/2024', '13/06/2024', '27/06/2024', '11/07/2024', '25/07/2024', '08/08/2024', '22/08/2024', '05/09/2024', '19/09/2024', '03/10/2024', '17/10/2024', '31/10/2024', '14/11/2024', '28/11/2024'], + 'Glass Box':['28/12/2023', '25/01/2024', '22/02/2024', '21/03/2024', '18/04/2024', '16/05/2024', '13/06/2024', '11/07/2024', '08/08/2024', '05/09/2024', '03/10/2024', '31/10/2024', '28/11/2024'] + }, + 'ThursdayG2-2024.pdf':{ + 'Black Bin':['14/12/2023', '28/12/2023', '11/01/2024', '25/01/2024', '08/02/2024', '22/02/2024', '07/03/2024', '21/03/2024', '04/04/2024', '18/04/2024', '02/05/2024', '16/05/2024', '30/05/2024', '13/06/2024', '27/06/2024', '11/07/2024', '25/07/2024', '08/08/2024', '22/08/2024', '05/09/2024', '19/09/2024', '03/10/2024', '17/10/2024', '31/10/2024', '14/11/2024', '28/11/2024'], + 'Green Bin':['07/12/2023', '20/12/2023', '04/01/2024', '18/01/2024', '01/02/2024', '15/02/2024', '29/02/2024', '14/03/2024', '28/03/2024', '11/04/2024', '25/04/2024', '09/05/2024', '23/05/2024', '06/06/2024', '20/06/2024', '04/07/2024', '18/07/2024', '01/08/2024', '15/08/2024', '29/08/2024', '12/09/2024', '26/09/2024', '10/10/2024', '24/10/2024', '07/11/2024', '21/11/2024'], + 'Glass Box':['07/12/2023', '04/01/2024', '01/02/2024', '29/02/2024', '28/03/2024', '25/04/2024', '23/05/2024', '20/06/2024', '18/07/2024', '15/08/2024', '12/09/2024', '10/10/2024', '07/11/2024'] + }, + 'ThursdayG3-2024.pdf':{ + 'Black Bin':['07/12/2023', '20/12/2023', '04/01/2024', '18/01/2024', '01/02/2024', '15/02/2024', '29/02/2024', '14/03/2024', '28/03/2024', '11/04/2024', '25/04/2024', '09/05/2024', '23/05/2024', '06/06/2024', '20/06/2024', '04/07/2024', '18/07/2024', '01/08/2024', '15/08/2024', '29/08/2024', '12/09/2024', '26/09/2024', '10/10/2024', '24/10/2024', '07/11/2024', '21/11/2024'], + 'Green Bin':['14/12/2023', '28/12/2023', '11/01/2024', '25/01/2024', '08/02/2024', '22/02/2024', '07/03/2024', '21/03/2024', '04/04/2024', '18/04/2024', '02/05/2024', '16/05/2024', '30/05/2024', '13/06/2024', '27/06/2024', '11/07/2024', '25/07/2024', '08/08/2024', '22/08/2024', '05/09/2024', '19/09/2024', '03/10/2024', '17/10/2024', '31/10/2024', '14/11/2024', '28/11/2024'], + 'Glass Box':['14/12/2023', '11/01/2024', '08/02/2024', '07/03/2024', '04/04/2024', '02/05/2024', '30/05/2024', '27/06/2024', '25/07/2024', '22/08/2024', '19/09/2024', '17/10/2024', '14/11/2024'] + }, + 'ThursdayG4-2024.pdf':{ + 'Black Bin':['14/12/2023', '28/12/2023', '11/01/2024', '25/01/2024', '08/02/2024', '22/02/2024', '07/03/2024', '21/03/2024', '04/04/2024', '18/04/2024', '02/05/2024', '16/05/2024', '30/05/2024', '13/06/2024', '27/06/2024', '11/07/2024', '25/07/2024', '08/08/2024', '22/08/2024', '05/09/2024', '19/09/2024', '03/10/2024', '17/10/2024', '31/10/2024', '14/11/2024', '28/11/2024'], + 'Green Bin':['07/12/2023', '20/12/2023', '04/01/2024', '18/01/2024', '01/02/2024', '15/02/2024', '29/02/2024', '14/03/2024', '28/03/2024', '11/04/2024', '25/04/2024', '09/05/2024', '23/05/2024', '06/06/2024', '20/06/2024', '04/07/2024', '18/07/2024', '01/08/2024', '15/08/2024', '29/08/2024', '12/09/2024', '26/09/2024', '10/10/2024', '24/10/2024', '07/11/2024', '21/11/2024'], + 'Glass Box':['20/12/2023', '18/01/2024', '15/02/2024', '14/03/2024', '11/04/2024', '09/05/2024', '06/06/2024', '04/07/2024', '01/08/2024', '29/08/2024', '26/09/2024', '24/10/2024', '21/11/2024'] + }, 'FridayG1-2024.pdf':{ 'Black Bin': ['08/12/2023', '22/12/2023', '05/01/2024', '19/01/2024', '02/02/2024', '16/02/2024', '01/03/2024', '15/03/2024', '29/03/2024', '12/04/2024', '26/04/2024', '10/05/2024', '24/05/2024', '07/06/2024', '21/06/2024', '05/07/2024', '19/07/2024', '02/08/2024', '16/08/2024', '30/08/2024', '13/09/2024', '27/09/2024', '11/10/2024', '25/10/2024', '08/11/2024', '22/11/2024'], 'Green Bin': ['01/12/2023', '15/12/2023', '29/12/2023', '12/01/2024', '26/01/2024', '09/02/2024', '23/02/2024', '08/03/2024', '22/03/2024', '05/04/2024', '19/04/2024', '03/05/2024', '17/05/2024', '31/05/2024', '14/06/2024', '28/06/2024', '12/07/2024', '26/07/2024', '09/08/2024', '23/08/2024', '06/09/2024', '20/09/2024', '04/10/2024', '18/10/2024', '01/11/2024', '15/11/2024', '29/11/2024'], @@ -97,10 +180,43 @@ def get_manual_data(self,type,calendar): } }, 'green': { - + 'Garden%20Waste%20A.pdf': { + 'Garden Bin': ['04/03/2024', '18/03/2024'] + }, + 'Garden%20Waste%20B.pdf': { + 'Garden Bin': ['05/03/2024', '19/03/2024'] + }, + 'Garden%20Waste%20C.pdf': { + 'Garden Bin': ['06/03/2024', '20/03/2024'] + }, + 'Garden%20Waste%20D.pdf': { + 'Garden Bin': ['07/03/2024', '21/03/2024'] + }, + 'Garden%20Waste%20E.pdf': { + 'Garden Bin': ['08/03/2024', '22/03/2024'] + }, + 'Garden%20Waste%20F.pdf': { + 'Garden Bin': ['11/03/2024', '25/03/2024'] + }, + 'Garden%20Waste%20G.pdf': { + 'Garden Bin': ['12/03/2024', '26/03/2024'] + }, + 'Garden%20Waste%20H.pdf': { + 'Garden Bin': ['13/03/2024', '27/03/2024'] + }, + 'Garden%20Waste%20I.pdf': { + 'Garden Bin': ['14/03/2024', '28/03/2024'] + }, + 'Garden%20Waste%20J.pdf': { + 'Garden Bin': ['01/03/2024', '15/03/2024', '29/03/2024'] + }, } } - return raw_data[type][calendar] + output = {} + output = raw_data['refuse'][refuse] + output['Garden Bin'] = raw_data['green'][garden]['Garden Bin'] + + return output