uk_bin_collection 0.86.2__py3-none-any.whl → 0.87.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -432,6 +432,7 @@
432
432
  "postcode": "GL2 0RR",
433
433
  "uprn": "100120479507",
434
434
  "skip_get_url": true,
435
+ "web_driver": "http://selenium:4444",
435
436
  "url": "https://gloucester-self.achieveservice.com/service/Bins___Check_your_bin_day",
436
437
  "wiki_name": "Gloucester City Council"
437
438
  },
@@ -498,6 +499,13 @@
498
499
  "wiki_name": "Huntingdon District Council",
499
500
  "wiki_note": "Replace XXXXXXXX with UPRN."
500
501
  },
502
+ "IslingtonCouncil": {
503
+ "uprn": "5300094897",
504
+ "url": "https://www.islington.gov.uk/your-area?Postcode=unused&Uprn=5300094897",
505
+ "wiki_command_url_override": "https://www.islington.gov.uk/your-area?Postcode=unused&Uprn=XXXXXXXX",
506
+ "wiki_name": "Islington Council",
507
+ "wiki_note": "Replace XXXXXXXX with UPRN."
508
+ },
501
509
  "KingstonUponThamesCouncil": {
502
510
  "url": "https://waste-services.kingston.gov.uk/waste/2701097",
503
511
  "wiki_command_url_override": "https://waste-services.kingston.gov.uk/waste/XXXXXXX",
@@ -1233,4 +1241,4 @@
1233
1241
  "url": "https://waste-api.york.gov.uk/api/Collections/GetBinCollectionDataForUprn/",
1234
1242
  "wiki_name": "York Council"
1235
1243
  }
1236
- }
1244
+ }
@@ -0,0 +1,37 @@
1
+ from bs4 import BeautifulSoup
2
+ from dateutil.parser import parse
3
+
4
+ from uk_bin_collection.uk_bin_collection.common import *
5
+ from uk_bin_collection.uk_bin_collection.get_bin_data import AbstractGetBinDataClass
6
+
7
+
8
+ class CouncilClass(AbstractGetBinDataClass):
9
+ def parse_data(self, page: str, **kwargs) -> dict:
10
+ uprn = kwargs.get("uprn")
11
+ check_uprn(uprn)
12
+
13
+ api_url = f"https://www.islington.gov.uk/your-area?Postcode=unused&Uprn={uprn}"
14
+ response = requests.get(api_url)
15
+
16
+ soup = BeautifulSoup(response.text, features="html.parser")
17
+
18
+ data = {"bins": []}
19
+
20
+ waste_table = (
21
+ soup.find(string="Waste and recycling collections")
22
+ .find_next("div", class_="m-toggle-content")
23
+ .find("table")
24
+ )
25
+
26
+ if waste_table:
27
+ rows = waste_table.find_all("tr")
28
+ for row in rows:
29
+ waste_type = row.find("th").text.strip()
30
+ next_collection = parse(row.find("td").text.strip()).date()
31
+
32
+ data['bins'].append({
33
+ "type": waste_type,
34
+ "collectionDate": next_collection.strftime(date_format),
35
+ })
36
+
37
+ return data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uk_bin_collection
3
- Version: 0.86.2
3
+ Version: 0.87.0
4
4
  Summary: Python Lib to collect UK Bin Data
5
5
  Author: Robert Bradley
6
6
  Author-email: robbrad182@gmail.com
@@ -2,7 +2,7 @@ uk_bin_collection/README.rst,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
2
2
  uk_bin_collection/tests/council_feature_input_parity.py,sha256=DO6Mk4ImYgM5ZCZ-cutwz5RoYYWZRLYx2tr6zIs_9Rc,3843
3
3
  uk_bin_collection/tests/features/environment.py,sha256=VQZjJdJI_kZn08M0j5cUgvKT4k3iTw8icJge1DGOkoA,127
4
4
  uk_bin_collection/tests/features/validate_council_outputs.feature,sha256=SJK-Vc737hrf03tssxxbeg_JIvAH-ddB8f6gU1LTbuQ,251
5
- uk_bin_collection/tests/input.json,sha256=WJ6GsmG_nIzmOA0ItYnBRc7DwWD8jsytgA6XO5WstMo,60242
5
+ uk_bin_collection/tests/input.json,sha256=o0-wIws6MTn7PlhE62IqVFi_NgQ0Koe55C-tBiR06QA,60643
6
6
  uk_bin_collection/tests/output.schema,sha256=ZwKQBwYyTDEM4G2hJwfLUVM-5v1vKRvRK9W9SS1sd18,1086
7
7
  uk_bin_collection/tests/step_defs/step_helpers/file_handler.py,sha256=Ygzi4V0S1MIHqbdstUlIqtRIwnynvhu4UtpweJ6-5N8,1474
8
8
  uk_bin_collection/tests/step_defs/test_validate_council.py,sha256=LrOSt_loA1Mw3vTqaO2LpaDMu7rYJy6k5Kr-EOBln7s,3424
@@ -80,6 +80,7 @@ uk_bin_collection/uk_bin_collection/councils/HighPeakCouncil.py,sha256=oybn_cbzj
80
80
  uk_bin_collection/uk_bin_collection/councils/HounslowCouncil.py,sha256=LXhJ47rujx7k3naz0tFiTT1l5k6gAYcVdekJN1t_HLY,4564
81
81
  uk_bin_collection/uk_bin_collection/councils/HullCityCouncil.py,sha256=UHcesBoctFVcXDYuwfag43KbcJcopkEDzJ-54NxtK0Q,1851
82
82
  uk_bin_collection/uk_bin_collection/councils/HuntingdonDistrictCouncil.py,sha256=dGyhhG6HRjQ2SPeiRwUPTGlk9dPIslagV2k0GjEOn1s,1587
83
+ uk_bin_collection/uk_bin_collection/councils/IslingtonCouncil.py,sha256=O2o5-oueMm8jXES_2kQGHVo-JpBSq1Z-1mqq11eyi3s,1208
83
84
  uk_bin_collection/uk_bin_collection/councils/KingstonUponThamesCouncil.py,sha256=iZ7njIxccCGBhUUWWd9Azh7cxUAKaofebCm3lo-TuxA,3543
84
85
  uk_bin_collection/uk_bin_collection/councils/KirkleesCouncil.py,sha256=gtAtM6FappSZ0-BKid7_pnSrnqPPjHn_UYWqMg9wQlM,4499
85
86
  uk_bin_collection/uk_bin_collection/councils/KnowsleyMBCouncil.py,sha256=VdlWDESoHfr_X0r8-UMaLMUQhKZOa2BnpVPkX-1u3EQ,5605
@@ -188,8 +189,8 @@ uk_bin_collection/uk_bin_collection/councils/YorkCouncil.py,sha256=I2kBYMlsD4bId
188
189
  uk_bin_collection/uk_bin_collection/councils/council_class_template/councilclasstemplate.py,sha256=4s9ODGPAwPqwXc8SrTX5Wlfmizs3_58iXUtHc4Ir86o,1162
189
190
  uk_bin_collection/uk_bin_collection/create_new_council.py,sha256=m-IhmWmeWQlFsTZC4OxuFvtw5ZtB8EAJHxJTH4O59lQ,1536
190
191
  uk_bin_collection/uk_bin_collection/get_bin_data.py,sha256=YvmHfZqanwrJ8ToGch34x-L-7yPe31nB_x77_Mgl_vo,4545
191
- uk_bin_collection-0.86.2.dist-info/LICENSE,sha256=vABBUOzcrgfaTKpzeo-si9YVEun6juDkndqA8RKdKGs,1071
192
- uk_bin_collection-0.86.2.dist-info/METADATA,sha256=LRsdDRZdbzUoFma7eHGhI7jA8ZtZrf7y4xaO_3q6Lcw,16231
193
- uk_bin_collection-0.86.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
194
- uk_bin_collection-0.86.2.dist-info/entry_points.txt,sha256=36WCSGMWSc916S3Hi1ZkazzDKHaJ6CD-4fCEFm5MIao,90
195
- uk_bin_collection-0.86.2.dist-info/RECORD,,
192
+ uk_bin_collection-0.87.0.dist-info/LICENSE,sha256=vABBUOzcrgfaTKpzeo-si9YVEun6juDkndqA8RKdKGs,1071
193
+ uk_bin_collection-0.87.0.dist-info/METADATA,sha256=HdjULR2SAGe8vVZR-jHEfpBF2TIS-jcuPdbmaIDnxdM,16231
194
+ uk_bin_collection-0.87.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
195
+ uk_bin_collection-0.87.0.dist-info/entry_points.txt,sha256=36WCSGMWSc916S3Hi1ZkazzDKHaJ6CD-4fCEFm5MIao,90
196
+ uk_bin_collection-0.87.0.dist-info/RECORD,,