uk_bin_collection 0.96.0__py3-none-any.whl → 0.97.1__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.
@@ -431,6 +431,13 @@
431
431
  "url": "https://map.erewash.gov.uk/isharelive.web/myerewash.aspx",
432
432
  "wiki_name": "Erewash Borough Council"
433
433
  },
434
+ "FalkirkCouncil": {
435
+ "url": "https://www.falkirk.gov.uk",
436
+ "wiki_command_url_override": "https://www.falkirk.gov.uk",
437
+ "uprn": "136065818",
438
+ "wiki_name": "Falkirk Council",
439
+ "wiki_note": "You will need to use [FindMyAddress](https://www.findmyaddress.co.uk/search) to find the UPRN."
440
+ },
434
441
  "FarehamBoroughCouncil": {
435
442
  "postcode": "PO14 4NR",
436
443
  "skip_get_url": true,
@@ -618,6 +625,13 @@
618
625
  "url": "https://www.ealing.gov.uk/site/custom_scripts/WasteCollectionWS/home/FindCollection",
619
626
  "wiki_name": "London Borough Ealing"
620
627
  },
628
+ "LondonBoroughHarrow": {
629
+ "url": "https://www.harrow.gov.uk",
630
+ "wiki_command_url_override": "https://www.harrow.gov.uk",
631
+ "uprn": "100021298754",
632
+ "wiki_name": "London Borough Harrow",
633
+ "wiki_note": "You will need to use [FindMyAddress](https://www.findmyaddress.co.uk/search) to find the UPRN."
634
+ },
621
635
  "LondonBoroughHounslow": {
622
636
  "skip_get_url": true,
623
637
  "uprn": "100021577765",
@@ -741,6 +755,13 @@
741
755
  "url": "https://www.newport.gov.uk/",
742
756
  "wiki_name": "Newport City Council"
743
757
  },
758
+ "NorthAyrshireCouncil": {
759
+ "url": "https://www.north-ayrshire.gov.uk/",
760
+ "wiki_command_url_override": "https://www.north-ayrshire.gov.uk/",
761
+ "uprn": "126045552",
762
+ "wiki_name": "North Ayrshire Council",
763
+ "wiki_note": "You will need to use [FindMyAddress](https://www.findmyaddress.co.uk/search) to find the UPRN."
764
+ },
744
765
  "NorthEastDerbyshireDistrictCouncil": {
745
766
  "postcode": "S42 5RB",
746
767
  "skip_get_url": true,
@@ -828,7 +849,7 @@
828
849
  "NottinghamCityCouncil": {
829
850
  "skip_get_url": true,
830
851
  "uprn": "100031540180",
831
- "url": "https://geoserver.nottinghamcity.gov.uk/myproperty/handler/proxy.ashx?https://geoserver.nottinghamcity.gov.uk/bincollections2/api/collection/100031540180",
852
+ "url": "https://geoserver.nottinghamcity.gov.uk/bincollections2/api/collection/100031540180",
832
853
  "wiki_name": "Nottingham City Council"
833
854
  },
834
855
  "OldhamCouncil": {
@@ -0,0 +1,54 @@
1
+ import time
2
+
3
+ import requests
4
+
5
+ from uk_bin_collection.uk_bin_collection.common import *
6
+ from uk_bin_collection.uk_bin_collection.get_bin_data import AbstractGetBinDataClass
7
+
8
+
9
+ # import the wonderful Beautiful Soup and the URL grabber
10
+ class CouncilClass(AbstractGetBinDataClass):
11
+ """
12
+ Concrete classes have to implement all abstract operations of the
13
+ base class. They can also override some operations with a default
14
+ implementation.
15
+ """
16
+
17
+ def parse_data(self, page: str, **kwargs) -> dict:
18
+
19
+ user_uprn = kwargs.get("uprn")
20
+ check_uprn(user_uprn)
21
+ bindata = {"bins": []}
22
+
23
+ URI = f"https://recycling.falkirk.gov.uk/api/collections/{user_uprn}"
24
+
25
+ # Make the GET request
26
+ response = requests.get(URI)
27
+
28
+ # Parse the JSON response
29
+ bin_collection = response.json()
30
+
31
+ # Loop through each collection in bin_collection
32
+ for collection in bin_collection["collections"]:
33
+ bin_type = collection["type"]
34
+ collection_dates = collection["dates"]
35
+
36
+ # Loop through the dates for each collection type
37
+ for date in collection_dates:
38
+ print(f"Bin Type: {bin_type}")
39
+ print(f"Collection Date: {date}")
40
+
41
+ dict_data = {
42
+ "type": bin_type,
43
+ "collectionDate": datetime.strptime(
44
+ date,
45
+ "%Y-%m-%d",
46
+ ).strftime("%d/%m/%Y"),
47
+ }
48
+ bindata["bins"].append(dict_data)
49
+
50
+ bindata["bins"].sort(
51
+ key=lambda x: datetime.strptime(x.get("collectionDate"), "%d/%m/%Y")
52
+ )
53
+
54
+ return bindata
@@ -0,0 +1,46 @@
1
+ import time
2
+
3
+ import requests
4
+
5
+ from uk_bin_collection.uk_bin_collection.common import *
6
+ from uk_bin_collection.uk_bin_collection.get_bin_data import AbstractGetBinDataClass
7
+
8
+
9
+ # import the wonderful Beautiful Soup and the URL grabber
10
+ class CouncilClass(AbstractGetBinDataClass):
11
+ """
12
+ Concrete classes have to implement all abstract operations of the
13
+ base class. They can also override some operations with a default
14
+ implementation.
15
+ """
16
+
17
+ def parse_data(self, page: str, **kwargs) -> dict:
18
+
19
+ user_uprn = kwargs.get("uprn")
20
+ check_uprn(user_uprn)
21
+ bindata = {"bins": []}
22
+
23
+ # Construct the URI
24
+ URI = f"https://www.harrow.gov.uk/ajax/bins?u={user_uprn}&r=12345"
25
+
26
+ # Make the GET request
27
+ response = requests.get(URI)
28
+
29
+ # Parse the JSON response
30
+ bin_collection = response.json()
31
+
32
+ # Loop through all collections and extract bin type and collection date
33
+ for collection in bin_collection["results"]["collections"]["all"]:
34
+
35
+ CollectTime = (collection["eventTime"]).split("T")[0]
36
+ print(CollectTime)
37
+
38
+ dict_data = {
39
+ "type": collection["binType"],
40
+ "collectionDate": datetime.strptime(CollectTime, "%Y-%m-%d").strftime(
41
+ "%d/%m/%Y"
42
+ ),
43
+ }
44
+ bindata["bins"].append(dict_data)
45
+
46
+ return bindata
@@ -0,0 +1,49 @@
1
+ import time
2
+
3
+ import requests
4
+
5
+ from uk_bin_collection.uk_bin_collection.common import *
6
+ from uk_bin_collection.uk_bin_collection.get_bin_data import AbstractGetBinDataClass
7
+
8
+
9
+ # import the wonderful Beautiful Soup and the URL grabber
10
+ class CouncilClass(AbstractGetBinDataClass):
11
+ """
12
+ Concrete classes have to implement all abstract operations of the
13
+ base class. They can also override some operations with a default
14
+ implementation.
15
+ """
16
+
17
+ def parse_data(self, page: str, **kwargs) -> dict:
18
+
19
+ user_uprn = kwargs.get("uprn")
20
+ check_uprn(user_uprn)
21
+ bindata = {"bins": []}
22
+
23
+ URI = f"https://www.maps.north-ayrshire.gov.uk/arcgis/rest/services/AGOL/YourLocationLive/MapServer/8/query?f=json&outFields=*&returnDistinctValues=true&returnGeometry=false&spatialRel=esriSpatialRelIntersects&where=UPRN%20%3D%20%27{user_uprn}%27"
24
+
25
+ # Make the GET request
26
+ response = requests.get(URI)
27
+
28
+ # Parse the JSON response
29
+ result_json = response.json()
30
+
31
+ # Extract bin collection dates
32
+ blue_bin = result_json["features"][0]["attributes"].get("BLUE_DATE_TEXT")
33
+ if blue_bin:
34
+ dict_data = {"type": "Blue Bin", "collectionDate": blue_bin}
35
+ bindata["bins"].append(dict_data)
36
+ grey_bin = result_json["features"][0]["attributes"].get("GREY_DATE_TEXT")
37
+ if grey_bin:
38
+ dict_data = {"type": "Grey Bin", "collectionDate": grey_bin}
39
+ bindata["bins"].append(dict_data)
40
+ purple_bin = result_json["features"][0]["attributes"].get("PURPLE_DATE_TEXT")
41
+ if purple_bin:
42
+ dict_data = {"type": "Purple Bin", "collectionDate": purple_bin}
43
+ bindata["bins"].append(dict_data)
44
+ brown_bin = result_json["features"][0]["attributes"].get("BROWN_DATE_TEXT")
45
+ if brown_bin:
46
+ dict_data = {"type": "Brown Bin", "collectionDate": brown_bin}
47
+ bindata["bins"].append(dict_data)
48
+
49
+ return bindata
@@ -1,4 +1,5 @@
1
1
  from bs4 import BeautifulSoup
2
+
2
3
  from uk_bin_collection.uk_bin_collection.common import *
3
4
  from uk_bin_collection.uk_bin_collection.get_bin_data import AbstractGetBinDataClass
4
5
 
@@ -14,7 +15,7 @@ class CouncilClass(AbstractGetBinDataClass):
14
15
  user_uprn = kwargs.get("uprn")
15
16
  check_uprn(user_uprn)
16
17
 
17
- api_url = f"https://geoserver.nottinghamcity.gov.uk/myproperty/handler/proxy.ashx?https://geoserver.nottinghamcity.gov.uk/bincollections2/api/collection/{user_uprn}"
18
+ api_url = f"https://geoserver.nottinghamcity.gov.uk/bincollections2/api/collection/{user_uprn}"
18
19
 
19
20
  requests.packages.urllib3.disable_warnings()
20
21
  response = requests.get(api_url)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uk_bin_collection
3
- Version: 0.96.0
3
+ Version: 0.97.1
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=heU28tV0vbQ8dbVkpiCpZfcETkiWoxu5wfgGvO_hmdk,65257
5
+ uk_bin_collection/tests/input.json,sha256=8RhkfF6YVhE9FmUJqcVUijxDlJvf-Kprcj12A7aPHOc,66218
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
@@ -71,6 +71,7 @@ uk_bin_collection/uk_bin_collection/councils/EnfieldCouncil.py,sha256=HhKHlLciZK
71
71
  uk_bin_collection/uk_bin_collection/councils/EnvironmentFirst.py,sha256=_9QJYDHpdnYK5R6znvZk1w0F9GnPnI8G4b6I_p26h4U,1695
72
72
  uk_bin_collection/uk_bin_collection/councils/EppingForestDistrictCouncil.py,sha256=cKFllQ4zt6MGkwiz_HedZvw3iL1kRMLA6Ct2spUE5og,2085
73
73
  uk_bin_collection/uk_bin_collection/councils/ErewashBoroughCouncil.py,sha256=QTQA6NjZtTL2baDeerIQW1SQpawwu6kGDMGdVvYQRRo,2501
74
+ uk_bin_collection/uk_bin_collection/councils/FalkirkCouncil.py,sha256=C3OA9PEhBsCYPzwsSdqVi_SbF8uiB186i2XfHWKd3VI,1694
74
75
  uk_bin_collection/uk_bin_collection/councils/FarehamBoroughCouncil.py,sha256=25QxeN5q3ad1Wwexs2d-B7ooH0ru6pOUx58413FOTY4,2352
75
76
  uk_bin_collection/uk_bin_collection/councils/FenlandDistrictCouncil.py,sha256=sFrnKzIE2tIcz0YrC6A9HcevzgNdf6E6_HLGMWDKtGw,2513
76
77
  uk_bin_collection/uk_bin_collection/councils/ForestOfDeanDistrictCouncil.py,sha256=xO5gqgsN9K-cQsuDoQF7ycZkjNdCPAQwIYOCFWxFJ_Y,4504
@@ -96,6 +97,7 @@ uk_bin_collection/uk_bin_collection/councils/LeedsCityCouncil.py,sha256=iSZApZ9o
96
97
  uk_bin_collection/uk_bin_collection/councils/LisburnCastlereaghCityCouncil.py,sha256=vSOzdEwp9ZeUhed7E3eVv9ReD-2XgbSkpyAbVnfc-Gk,3309
97
98
  uk_bin_collection/uk_bin_collection/councils/LiverpoolCityCouncil.py,sha256=n17OqZrCGrPrnxGUfHc-RGkb4oJ9Bx6uUWiLdzxfQlY,2587
98
99
  uk_bin_collection/uk_bin_collection/councils/LondonBoroughEaling.py,sha256=QDx2Izr-6hUSFMi4UWqsgo3p6U8aRZ9d_Cu9cBSp2rY,1653
100
+ uk_bin_collection/uk_bin_collection/councils/LondonBoroughHarrow.py,sha256=kzKwbjDBCbJXF6JdvTZWdXK0fpZxuH1CQF9GGyVMAus,1408
99
101
  uk_bin_collection/uk_bin_collection/councils/LondonBoroughHounslow.py,sha256=UOeiOxGMvVMm2UFaqjmQpm7vxzqJNSSN8LM9lAUjs2c,3021
100
102
  uk_bin_collection/uk_bin_collection/councils/LondonBoroughLambeth.py,sha256=r9D5lHe5kIRStCd5lRIax16yhb4KTFzzfYEFv1bacWw,2009
101
103
  uk_bin_collection/uk_bin_collection/councils/LondonBoroughRedbridge.py,sha256=A_6Sis5hsF53Th04KeadHRasGbpAm6aoaWJ6X8eC4Y8,6604
@@ -114,6 +116,7 @@ uk_bin_collection/uk_bin_collection/councils/NewarkAndSherwoodDC.py,sha256=lAleY
114
116
  uk_bin_collection/uk_bin_collection/councils/NewcastleCityCouncil.py,sha256=eJMX10CG9QO7FRhHSmUDL-jO_44qoK3_1ztNTAXhkbw,2085
115
117
  uk_bin_collection/uk_bin_collection/councils/NewhamCouncil.py,sha256=klFqr2Km1BuQ4wERmjbXZzOvN1N0jnVmhTGRSVzVOaU,2086
116
118
  uk_bin_collection/uk_bin_collection/councils/NewportCityCouncil.py,sha256=dAcl5P97bttl2xCPvxof1a18kmqOrMmiElgtn3Ej7zs,8480
119
+ uk_bin_collection/uk_bin_collection/councils/NorthAyrshireCouncil.py,sha256=o8zv40Wt19d51mrN5lsgLMCKMokMPmI1cMHBNT5yAho,1976
117
120
  uk_bin_collection/uk_bin_collection/councils/NorthEastDerbyshireDistrictCouncil.py,sha256=bps_uCFAeUHQla7AE5lZOv6sUkUz1fb6zduZdAcYMuw,4651
118
121
  uk_bin_collection/uk_bin_collection/councils/NorthEastLincs.py,sha256=fYf438VZIaOaqPSwdTTWVjFTdrI0jGfFsxVzOc-QdkA,1817
119
122
  uk_bin_collection/uk_bin_collection/councils/NorthKestevenDistrictCouncil.py,sha256=vYOCerJXr9LTP6F2wm4vpYNYbQaWNZ6yfHEQ33N_hTw,1681
@@ -126,7 +129,7 @@ uk_bin_collection/uk_bin_collection/councils/NorthTynesideCouncil.py,sha256=N_ZR
126
129
  uk_bin_collection/uk_bin_collection/councils/NorthWestLeicestershire.py,sha256=gJj0dyQc5QUefqusKGk2LLXfWbG5tlEXUOh8KAPh3RI,4584
127
130
  uk_bin_collection/uk_bin_collection/councils/NorthYorkshire.py,sha256=2wTrr3VrZDp9-YtDPmWd649gXeWH4hbm2-Hw8Vau5Xs,1933
128
131
  uk_bin_collection/uk_bin_collection/councils/NorthumberlandCouncil.py,sha256=KEFsxEvQ159fkuFo-fza67YCnnCZ5ElwE80zTrqDEWI,4990
129
- uk_bin_collection/uk_bin_collection/councils/NottinghamCityCouncil.py,sha256=SfjQ17er2heXzO6-PUVQFZqOK8akfJ4sQh1FJYgYxkM,1323
132
+ uk_bin_collection/uk_bin_collection/councils/NottinghamCityCouncil.py,sha256=panTCjnsBOQ98-TBO9xVZk_jcT_gjMhx3Gg5oWxBRLo,1254
130
133
  uk_bin_collection/uk_bin_collection/councils/OldhamCouncil.py,sha256=9dlesCxNoVXlmQaqZj7QFh00smnJbm1Gnjkr_Uvzurs,1771
131
134
  uk_bin_collection/uk_bin_collection/councils/PortsmouthCityCouncil.py,sha256=xogNgVvwM5FljCziiNLgZ_wzkOnrQkifi1dkPMDRMtg,5588
132
135
  uk_bin_collection/uk_bin_collection/councils/PrestonCityCouncil.py,sha256=3Nuin2hQsiEsbJR_kHldtzRhzmnPFctH7C7MFG7thj8,3838
@@ -202,8 +205,8 @@ uk_bin_collection/uk_bin_collection/councils/YorkCouncil.py,sha256=I2kBYMlsD4bId
202
205
  uk_bin_collection/uk_bin_collection/councils/council_class_template/councilclasstemplate.py,sha256=4s9ODGPAwPqwXc8SrTX5Wlfmizs3_58iXUtHc4Ir86o,1162
203
206
  uk_bin_collection/uk_bin_collection/create_new_council.py,sha256=m-IhmWmeWQlFsTZC4OxuFvtw5ZtB8EAJHxJTH4O59lQ,1536
204
207
  uk_bin_collection/uk_bin_collection/get_bin_data.py,sha256=YvmHfZqanwrJ8ToGch34x-L-7yPe31nB_x77_Mgl_vo,4545
205
- uk_bin_collection-0.96.0.dist-info/LICENSE,sha256=vABBUOzcrgfaTKpzeo-si9YVEun6juDkndqA8RKdKGs,1071
206
- uk_bin_collection-0.96.0.dist-info/METADATA,sha256=BGnwvmk6ZjWGYrBNl0FBDqMZGRmfAACqkC-V8BDtOBU,16843
207
- uk_bin_collection-0.96.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
208
- uk_bin_collection-0.96.0.dist-info/entry_points.txt,sha256=36WCSGMWSc916S3Hi1ZkazzDKHaJ6CD-4fCEFm5MIao,90
209
- uk_bin_collection-0.96.0.dist-info/RECORD,,
208
+ uk_bin_collection-0.97.1.dist-info/LICENSE,sha256=vABBUOzcrgfaTKpzeo-si9YVEun6juDkndqA8RKdKGs,1071
209
+ uk_bin_collection-0.97.1.dist-info/METADATA,sha256=3g4xUnrSlmXcWZ1AgHfg6IcR9t14GIwZaNmPDv1zOZ8,16843
210
+ uk_bin_collection-0.97.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
211
+ uk_bin_collection-0.97.1.dist-info/entry_points.txt,sha256=36WCSGMWSc916S3Hi1ZkazzDKHaJ6CD-4fCEFm5MIao,90
212
+ uk_bin_collection-0.97.1.dist-info/RECORD,,