uk_bin_collection 0.152.6__py3-none-any.whl → 0.152.7__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.
@@ -69,8 +69,10 @@ class CouncilClass(AbstractGetBinDataClass):
69
69
  current_year = datetime.now().year
70
70
  bin_date = bin_date.replace(year=current_year)
71
71
 
72
- # If the date is in the past, it's probably for next year
73
- if bin_date < datetime.now():
72
+ # Only add a year if the date is more than 30 days in the past
73
+ # This handles both mid-year and year-end transitions better
74
+ today = datetime.now()
75
+ if (today - bin_date).days > 30:
74
76
  bin_date = bin_date.replace(year=current_year + 1)
75
77
 
76
78
  collections.append((bin_type, bin_date))
@@ -15,11 +15,15 @@ class CouncilClass(AbstractGetBinDataClass):
15
15
  user_uprn = kwargs.get("uprn")
16
16
 
17
17
  check_uprn(user_uprn)
18
-
18
+ headers = {
19
+ "Content-Type": "application/x-www-form-urlencoded",
20
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36",
21
+ }
19
22
  response = requests.post(
20
23
  "https://www.rotherham.gov.uk/bin-collections?address={}&submit=Submit".format(
21
24
  user_uprn
22
- )
25
+ ),
26
+ headers=headers
23
27
  )
24
28
  # Make a BS4 object
25
29
  soup = BeautifulSoup(response.text, features="html.parser")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uk_bin_collection
3
- Version: 0.152.6
3
+ Version: 0.152.7
4
4
  Summary: Python Lib to collect UK Bin Data
5
5
  Author: Robert Bradley
6
6
  Author-email: robbrad182@gmail.com
@@ -7,7 +7,7 @@ uk_bin_collection/tests/council_feature_input_parity.py,sha256=DO6Mk4ImYgM5ZCZ-c
7
7
  uk_bin_collection/tests/features/environment.py,sha256=VQZjJdJI_kZn08M0j5cUgvKT4k3iTw8icJge1DGOkoA,127
8
8
  uk_bin_collection/tests/features/validate_council_outputs.feature,sha256=SJK-Vc737hrf03tssxxbeg_JIvAH-ddB8f6gU1LTbuQ,251
9
9
  uk_bin_collection/tests/generate_map_test_results.py,sha256=CKnGK2ZgiSXomRGkomX90DitgMP-X7wkHhyKORDcL2E,1144
10
- uk_bin_collection/tests/input.json,sha256=Xoq9-6sQ5Yc91jPFXx6hJucoyOOc1exTVQ9jS_m-JkY,135599
10
+ uk_bin_collection/tests/input.json,sha256=t3mswyBreR1D4dTPAXzXmnqXCU6xJ1e7QPO5WpjGu1A,132839
11
11
  uk_bin_collection/tests/output.schema,sha256=ZwKQBwYyTDEM4G2hJwfLUVM-5v1vKRvRK9W9SS1sd18,1086
12
12
  uk_bin_collection/tests/step_defs/step_helpers/file_handler.py,sha256=Ygzi4V0S1MIHqbdstUlIqtRIwnynvhu4UtpweJ6-5N8,1474
13
13
  uk_bin_collection/tests/step_defs/test_validate_council.py,sha256=VZ0a81sioJULD7syAYHjvK_-nT_Rd36tUyzPetSA0gk,3475
@@ -19,7 +19,7 @@ uk_bin_collection/uk_bin_collection/collect_data.py,sha256=dB7wWXsJX4fm5bIf84lex
19
19
  uk_bin_collection/uk_bin_collection/common.py,sha256=izotgwavB08pUWisNL3wqcBrE9E1-bdrq-v6YKyriDE,11034
20
20
  uk_bin_collection/uk_bin_collection/councils/AberdeenCityCouncil.py,sha256=Je8VwVLK9KnYl9vqf2gWJ7ZYDgUq3A7caDiIzk5Xof8,4194
21
21
  uk_bin_collection/uk_bin_collection/councils/AberdeenshireCouncil.py,sha256=aO1CSdyqa8oAD0fB79y1Q9bikAWCP_JFa7CsyTa2j9s,1655
22
- uk_bin_collection/uk_bin_collection/councils/AdurAndWorthingCouncils.py,sha256=N0BcdTxRlCiCh6SPluPK3wMlNDli8_wJgUOOwe4hgSE,4250
22
+ uk_bin_collection/uk_bin_collection/councils/AdurAndWorthingCouncils.py,sha256=2fU4E2hnblgzlS-hGkaczbzg4I3-lwIU0Fiszp_WnqM,4406
23
23
  uk_bin_collection/uk_bin_collection/councils/AmberValleyBoroughCouncil.py,sha256=mTeluIIEcuxLxhfDQ95A1fp8RM6AkJT5tRGZPUbYGdk,1853
24
24
  uk_bin_collection/uk_bin_collection/councils/AngusCouncil.py,sha256=YlhAnxkRAAvrwbUvleNKUuLROcwMTps2eMHElpuctm4,5894
25
25
  uk_bin_collection/uk_bin_collection/councils/AntrimAndNewtonabbeyCouncil.py,sha256=Hp5pteaC5RjL5ZqPZ564S9WQ6ZTKLMO6Dl_fxip2TUc,1653
@@ -246,7 +246,7 @@ uk_bin_collection/uk_bin_collection/councils/RhonddaCynonTaffCouncil.py,sha256=w
246
246
  uk_bin_collection/uk_bin_collection/councils/RochdaleCouncil.py,sha256=UTSwSw515VehGn4xkjjRhUlzS4lDj4hgna6y-4VW3uM,2379
247
247
  uk_bin_collection/uk_bin_collection/councils/RochfordCouncil.py,sha256=rfhD66A9HfHL46ldF9sbxvV7fPaaoNxzIJbHjVT6A90,2621
248
248
  uk_bin_collection/uk_bin_collection/councils/RotherDistrictCouncil.py,sha256=-fdLvtik9ytfwXrrhwWdBxqQOMq2N1pvrIuvShhf8PU,3090
249
- uk_bin_collection/uk_bin_collection/councils/RotherhamCouncil.py,sha256=LtMPM8lj5bfReDR4buHEo-aRC_HTBIeo1nf8GE5-R80,1790
249
+ uk_bin_collection/uk_bin_collection/councils/RotherhamCouncil.py,sha256=dfAqXtmbptHGZGGWkurjY9snaVm1aH5CGjhzdtoe4JM,2058
250
250
  uk_bin_collection/uk_bin_collection/councils/RoyalBoroughofGreenwich.py,sha256=BZzLmWK_VONOmMpSrLrnKtJaOrrepm6aStfKGVcgf9Y,3487
251
251
  uk_bin_collection/uk_bin_collection/councils/RugbyBoroughCouncil.py,sha256=WlmOD-xHJFdowI9fGuGDHOpnAVHGUWxGZqmJ6z4fGXs,5687
252
252
  uk_bin_collection/uk_bin_collection/councils/RunnymedeBoroughCouncil.py,sha256=vmTZfijt9b6sKzRdRwROE94lrMVnqs6kn6tg-xi1jR4,1618
@@ -346,8 +346,8 @@ uk_bin_collection/uk_bin_collection/councils/YorkCouncil.py,sha256=I2kBYMlsD4bId
346
346
  uk_bin_collection/uk_bin_collection/councils/council_class_template/councilclasstemplate.py,sha256=QD4v4xpsEE0QheR_fGaNOIRMc2FatcUfKkkhAhseyVU,1159
347
347
  uk_bin_collection/uk_bin_collection/create_new_council.py,sha256=m-IhmWmeWQlFsTZC4OxuFvtw5ZtB8EAJHxJTH4O59lQ,1536
348
348
  uk_bin_collection/uk_bin_collection/get_bin_data.py,sha256=YvmHfZqanwrJ8ToGch34x-L-7yPe31nB_x77_Mgl_vo,4545
349
- uk_bin_collection-0.152.6.dist-info/LICENSE,sha256=vABBUOzcrgfaTKpzeo-si9YVEun6juDkndqA8RKdKGs,1071
350
- uk_bin_collection-0.152.6.dist-info/METADATA,sha256=sNfl9s2XJPOukcSK5-3R-Vf37i8Zi2wOhJnPom0nwq4,26688
351
- uk_bin_collection-0.152.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
352
- uk_bin_collection-0.152.6.dist-info/entry_points.txt,sha256=36WCSGMWSc916S3Hi1ZkazzDKHaJ6CD-4fCEFm5MIao,90
353
- uk_bin_collection-0.152.6.dist-info/RECORD,,
349
+ uk_bin_collection-0.152.7.dist-info/LICENSE,sha256=vABBUOzcrgfaTKpzeo-si9YVEun6juDkndqA8RKdKGs,1071
350
+ uk_bin_collection-0.152.7.dist-info/METADATA,sha256=a85PSabORrNpgMeGeNwj8ZsL45LGVVoqcRBW3n6bfUc,26688
351
+ uk_bin_collection-0.152.7.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
352
+ uk_bin_collection-0.152.7.dist-info/entry_points.txt,sha256=36WCSGMWSc916S3Hi1ZkazzDKHaJ6CD-4fCEFm5MIao,90
353
+ uk_bin_collection-0.152.7.dist-info/RECORD,,