uk_bin_collection 0.87.0__py3-none-any.whl → 0.88.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.
@@ -314,6 +314,12 @@
314
314
  "url": "https://www.durham.gov.uk/bincollections?uprn=",
315
315
  "wiki_name": "Durham Council"
316
316
  },
317
+ "EalingCouncil": {
318
+ "skip_get_url": true,
319
+ "uprn": "12073883",
320
+ "url": "https://www.ealing.gov.uk/site/custom_scripts/WasteCollectionWS/home/FindCollection",
321
+ "wiki_name": "Ealing Council"
322
+ },
317
323
  "EastCambridgeshireCouncil": {
318
324
  "skip_get_url": true,
319
325
  "uprn": "10002597178",
@@ -0,0 +1,43 @@
1
+ import json
2
+ from uk_bin_collection.uk_bin_collection.common import *
3
+ from uk_bin_collection.uk_bin_collection.get_bin_data import AbstractGetBinDataClass
4
+
5
+
6
+ class CouncilClass(AbstractGetBinDataClass):
7
+ """
8
+ Concrete classes have to implement all abstract operations of the
9
+ base class. They can also override some operations with a default
10
+ implementation.
11
+ """
12
+
13
+ def parse_data(self, page: str, **kwargs) -> dict:
14
+ api_url = "https://www.ealing.gov.uk/site/custom_scripts/WasteCollectionWS/home/FindCollection"
15
+ user_uprn = kwargs.get("uprn")
16
+
17
+ # Check the UPRN is valid
18
+ check_uprn(user_uprn)
19
+
20
+ # Create the form data
21
+ form_data = {
22
+ "UPRN": user_uprn,
23
+ }
24
+
25
+ # Make a request to the API
26
+ requests.packages.urllib3.disable_warnings()
27
+ response = requests.post(api_url, data=form_data)
28
+
29
+ json_data = json.loads(response.text)
30
+
31
+ data = {"bins": []}
32
+
33
+ for param in json_data["param2"]:
34
+ data["bins"].append(
35
+ {
36
+ "type": param["Service"],
37
+ "collectionDate": datetime.strptime(
38
+ param["collectionDateString"], "%d/%m/%Y"
39
+ ).strftime(date_format),
40
+ }
41
+ )
42
+
43
+ return data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uk_bin_collection
3
- Version: 0.87.0
3
+ Version: 0.88.0
4
4
  Summary: Python Lib to collect UK Bin Data
5
5
  Author: Robert Bradley
6
6
  Author-email: robbrad182@gmail.com
@@ -57,6 +57,15 @@ Most scripts make use of [Beautiful Soup 4](https://pypi.org/project/beautifulso
57
57
 
58
58
  ### Install with HACS (recommended)
59
59
 
60
+ #### Automated
61
+ [![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg?style=for-the-badge)](https://github.com/hacs/integration)
62
+
63
+ This integration can be installed directly via HACS. To install:
64
+
65
+ * [Add the repository](https://my.home-assistant.io/redirect/hacs_repository/?owner=robbrad&repository=UKBinCollectionData&category=integration) to your HACS installation
66
+ * Click `Download`
67
+
68
+ #### Manual
60
69
  1. Ensure you have [HACS](https://hacs.xyz/) installed
61
70
  1. In the Home Assistant UI go to `HACS` > `Integrations` > `⋮` > `Custom repositories`.
62
71
  1. Enter `https://github.com/robbrad/UKBinCollectionData` in the `Repository` field.
@@ -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=o0-wIws6MTn7PlhE62IqVFi_NgQ0Koe55C-tBiR06QA,60643
5
+ uk_bin_collection/tests/input.json,sha256=p6iViHOSYbTWhUp9ICC46nws0Wusa7akA5k5--vGQaI,60871
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
@@ -55,6 +55,7 @@ uk_bin_collection/uk_bin_collection/councils/DoncasterCouncil.py,sha256=b7pxoToX
55
55
  uk_bin_collection/uk_bin_collection/councils/DorsetCouncil.py,sha256=zfXQJpywfEQvBOhv5uPSkHdTrAg114yXIuTYDjHSXsA,1629
56
56
  uk_bin_collection/uk_bin_collection/councils/DoverDistrictCouncil.py,sha256=3Zgap6kaVpDXtRfBKEL1Ms6eb0iFIipYKNtOq3Hrdd4,1891
57
57
  uk_bin_collection/uk_bin_collection/councils/DurhamCouncil.py,sha256=6O8bNsQVYQbrCYQE9Rp0c_rtkcXuxR3s9J6jn4MK4_s,1695
58
+ uk_bin_collection/uk_bin_collection/councils/EalingCouncil.py,sha256=UhNXGi-_6NYZu50988VEvOzmAVunxOoyJ6mz0OEaUz4,1321
58
59
  uk_bin_collection/uk_bin_collection/councils/EastCambridgeshireCouncil.py,sha256=aYUVE5QqTxdj8FHhCB4EiFVDJahWJD9Pq0d1upBEvXg,1501
59
60
  uk_bin_collection/uk_bin_collection/councils/EastDevonDC.py,sha256=U0VwSNIldMv5nUoiXtFgjbE0m6Kb-8W2WZQGVCNF_WI,3261
60
61
  uk_bin_collection/uk_bin_collection/councils/EastLindseyDistrictCouncil.py,sha256=o_HPSFhb2ybmwv32_7T7CO1f2mGDkYCNPfaM5xz6bUI,4356
@@ -189,8 +190,8 @@ uk_bin_collection/uk_bin_collection/councils/YorkCouncil.py,sha256=I2kBYMlsD4bId
189
190
  uk_bin_collection/uk_bin_collection/councils/council_class_template/councilclasstemplate.py,sha256=4s9ODGPAwPqwXc8SrTX5Wlfmizs3_58iXUtHc4Ir86o,1162
190
191
  uk_bin_collection/uk_bin_collection/create_new_council.py,sha256=m-IhmWmeWQlFsTZC4OxuFvtw5ZtB8EAJHxJTH4O59lQ,1536
191
192
  uk_bin_collection/uk_bin_collection/get_bin_data.py,sha256=YvmHfZqanwrJ8ToGch34x-L-7yPe31nB_x77_Mgl_vo,4545
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,,
193
+ uk_bin_collection-0.88.0.dist-info/LICENSE,sha256=vABBUOzcrgfaTKpzeo-si9YVEun6juDkndqA8RKdKGs,1071
194
+ uk_bin_collection-0.88.0.dist-info/METADATA,sha256=kEIvcUhPtE0L1WNL_Oad5JcufNcj9mK2F2xei7bjD7I,16643
195
+ uk_bin_collection-0.88.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
196
+ uk_bin_collection-0.88.0.dist-info/entry_points.txt,sha256=36WCSGMWSc916S3Hi1ZkazzDKHaJ6CD-4fCEFm5MIao,90
197
+ uk_bin_collection-0.88.0.dist-info/RECORD,,