uk_bin_collection 0.87.0__py3-none-any.whl → 0.89.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.
- uk_bin_collection/tests/input.json +6 -0
- uk_bin_collection/uk_bin_collection/councils/CheshireEastCouncil.py +1 -1
- uk_bin_collection/uk_bin_collection/councils/EalingCouncil.py +43 -0
- {uk_bin_collection-0.87.0.dist-info → uk_bin_collection-0.89.0.dist-info}/METADATA +10 -2
- {uk_bin_collection-0.87.0.dist-info → uk_bin_collection-0.89.0.dist-info}/RECORD +8 -7
- {uk_bin_collection-0.87.0.dist-info → uk_bin_collection-0.89.0.dist-info}/LICENSE +0 -0
- {uk_bin_collection-0.87.0.dist-info → uk_bin_collection-0.89.0.dist-info}/WHEEL +0 -0
- {uk_bin_collection-0.87.0.dist-info → uk_bin_collection-0.89.0.dist-info}/entry_points.txt +0 -0
@@ -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",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from bs4 import BeautifulSoup
|
2
2
|
from uk_bin_collection.uk_bin_collection.get_bin_data import AbstractGetBinDataClass
|
3
3
|
|
4
|
-
|
4
|
+
#Cheshire East
|
5
5
|
class CouncilClass(AbstractGetBinDataClass):
|
6
6
|
def parse_data(self, page: str, **kwargs) -> dict:
|
7
7
|
soup = BeautifulSoup(page.text, features="html.parser")
|
@@ -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.
|
3
|
+
Version: 0.89.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
|
+
[](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.
|
@@ -362,4 +371,3 @@ Contributions are always welcome! See ```CONTRIBUTING.md``` to get started. Plea
|
|
362
371
|
<img src="https://contrib.rocks/image?repo=robbrad/UKBinCollectionData" alt="Image of contributors"/>
|
363
372
|
</a>
|
364
373
|
|
365
|
-
|
@@ -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=
|
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
|
@@ -41,7 +41,7 @@ uk_bin_collection/uk_bin_collection/councils/CardiffCouncil.py,sha256=_k3sT_WR-g
|
|
41
41
|
uk_bin_collection/uk_bin_collection/councils/CastlepointDistrictCouncil.py,sha256=JVPYUIlU2ISgbUSr5AOOXNK6IFQFtQmhZyYIMAOedD4,3858
|
42
42
|
uk_bin_collection/uk_bin_collection/councils/CharnwoodBoroughCouncil.py,sha256=tXfzMetN6wxahuGGRp2mIyCCDSL4F2aG61HhUxw6COQ,2172
|
43
43
|
uk_bin_collection/uk_bin_collection/councils/ChelmsfordCityCouncil.py,sha256=EB88D0MNJwuDZ2GX1ENc5maGYx17mnHTCtNl6s-v11E,5090
|
44
|
-
uk_bin_collection/uk_bin_collection/councils/CheshireEastCouncil.py,sha256=
|
44
|
+
uk_bin_collection/uk_bin_collection/councils/CheshireEastCouncil.py,sha256=VZQsiSZX7Wdta3cXCBOcLv-muLb9EVmmUDEHerWyR3o,1146
|
45
45
|
uk_bin_collection/uk_bin_collection/councils/CheshireWestAndChesterCouncil.py,sha256=M58kIHCAZu1K5qBp6_M4sw8nMvHz38YkoxY_sNuhvOI,4780
|
46
46
|
uk_bin_collection/uk_bin_collection/councils/ChichesterDistrictCouncil.py,sha256=HxrLcJves7ZsE8FbooymeecTUmScY4R7Oi71vwCePPo,4118
|
47
47
|
uk_bin_collection/uk_bin_collection/councils/ChorleyCouncil.py,sha256=M7HjuUaFq8aSnOf_9m1QS4MmPPMmPhF3mLHSrfDPtV0,5194
|
@@ -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.
|
193
|
-
uk_bin_collection-0.
|
194
|
-
uk_bin_collection-0.
|
195
|
-
uk_bin_collection-0.
|
196
|
-
uk_bin_collection-0.
|
193
|
+
uk_bin_collection-0.89.0.dist-info/LICENSE,sha256=vABBUOzcrgfaTKpzeo-si9YVEun6juDkndqA8RKdKGs,1071
|
194
|
+
uk_bin_collection-0.89.0.dist-info/METADATA,sha256=fln9Sc_f4ZPtYS8V5OYFCKbFbXBDBYcxHxn1RJLEtyE,16642
|
195
|
+
uk_bin_collection-0.89.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
196
|
+
uk_bin_collection-0.89.0.dist-info/entry_points.txt,sha256=36WCSGMWSc916S3Hi1ZkazzDKHaJ6CD-4fCEFm5MIao,90
|
197
|
+
uk_bin_collection-0.89.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|