uk_bin_collection 0.74.0__tar.gz
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-0.74.0/LICENSE +21 -0
- uk_bin_collection-0.74.0/PKG-INFO +247 -0
- uk_bin_collection-0.74.0/README.md +223 -0
- uk_bin_collection-0.74.0/pyproject.toml +72 -0
- uk_bin_collection-0.74.0/uk_bin_collection/README.rst +0 -0
- uk_bin_collection-0.74.0/uk_bin_collection/tests/council_feature_input_parity.py +79 -0
- uk_bin_collection-0.74.0/uk_bin_collection/tests/features/environment.py +7 -0
- uk_bin_collection-0.74.0/uk_bin_collection/tests/features/validate_council_outputs.feature +767 -0
- uk_bin_collection-0.74.0/uk_bin_collection/tests/input.json +1077 -0
- uk_bin_collection-0.74.0/uk_bin_collection/tests/output.schema +41 -0
- uk_bin_collection-0.74.0/uk_bin_collection/tests/step_defs/step_helpers/file_handler.py +46 -0
- uk_bin_collection-0.74.0/uk_bin_collection/tests/step_defs/test_validate_council.py +87 -0
- uk_bin_collection-0.74.0/uk_bin_collection/tests/test_collect_data.py +104 -0
- uk_bin_collection-0.74.0/uk_bin_collection/tests/test_common_functions.py +342 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/collect_data.py +133 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/common.py +292 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/AdurAndWorthingCouncils.py +43 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/ArunCouncil.py +97 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/AylesburyValeCouncil.py +69 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BCPCouncil.py +51 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BarnetCouncil.py +180 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BarnsleyMBCouncil.py +109 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BasingstokeCouncil.py +72 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BathAndNorthEastSomersetCouncil.py +100 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BedfordBoroughCouncil.py +49 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BedfordshireCouncil.py +70 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BexleyCouncil.py +147 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BirminghamCityCouncil.py +119 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BlackburnCouncil.py +105 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BoltonCouncil.py +104 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BradfordMDC.py +103 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BrightonandHoveCityCouncil.py +137 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BristolCityCouncil.py +141 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BromleyBoroughCouncil.py +115 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BroxtoweBoroughCouncil.py +107 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BuckinghamshireCouncil.py +95 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/BuryCouncil.py +65 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/CalderdaleCouncil.py +123 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/CannockChaseDistrictCouncil.py +65 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/CardiffCouncil.py +172 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/CastlepointDistrictCouncil.py +96 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/CharnwoodBoroughCouncil.py +54 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/ChelmsfordCityCouncil.py +127 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/CheshireEastCouncil.py +32 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/CheshireWestAndChesterCouncil.py +125 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/ChorleyCouncil.py +134 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/ConwyCountyBorough.py +27 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/CrawleyBoroughCouncil.py +61 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/CroydonCouncil.py +291 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/DerbyshireDalesDistrictCouncil.py +100 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/DoncasterCouncil.py +77 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/DorsetCouncil.py +58 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/DoverDistrictCouncil.py +41 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/DurhamCouncil.py +49 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/EastCambridgeshireCouncil.py +44 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/EastDevonDC.py +74 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/EastLindseyDistrictCouncil.py +108 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/EastRidingCouncil.py +142 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/EastSuffolkCouncil.py +112 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/EastleighBoroughCouncil.py +70 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/EnvironmentFirst.py +48 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/ErewashBoroughCouncil.py +61 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/FenlandDistrictCouncil.py +65 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/ForestOfDeanDistrictCouncil.py +113 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/GatesheadCouncil.py +118 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/GedlingBoroughCouncil.py +1580 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/GlasgowCityCouncil.py +55 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/GuildfordCouncil.py +150 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/HaltonBoroughCouncil.py +142 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/HaringeyCouncil.py +59 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/HarrogateBoroughCouncil.py +63 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/HighPeakCouncil.py +134 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/HullCityCouncil.py +48 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/HuntingdonDistrictCouncil.py +44 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/KingstonUponThamesCouncil.py +84 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/KirkleesCouncil.py +130 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/KnowsleyMBCouncil.py +139 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/LancasterCityCouncil.py +71 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/LeedsCityCouncil.py +137 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/LisburnCastlereaghCityCouncil.py +101 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/LiverpoolCityCouncil.py +65 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/LondonBoroughHounslow.py +82 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/LondonBoroughRedbridge.py +161 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/MaldonDistrictCouncil.py +52 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/MalvernHillsDC.py +57 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/ManchesterCityCouncil.py +106 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/MansfieldDistrictCouncil.py +38 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/MertonCouncil.py +58 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/MidAndEastAntrimBoroughCouncil.py +128 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/MidSussexDistrictCouncil.py +80 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/MiltonKeynesCityCouncil.py +54 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/MoleValleyDistrictCouncil.py +98 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NeathPortTalbotCouncil.py +139 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NewarkAndSherwoodDC.py +52 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NewcastleCityCouncil.py +57 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NewhamCouncil.py +58 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NewportCityCouncil.py +203 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NorthEastDerbyshireDistrictCouncil.py +115 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NorthEastLincs.py +53 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NorthKestevenDistrictCouncil.py +45 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NorthLanarkshireCouncil.py +46 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NorthLincolnshireCouncil.py +58 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NorthNorfolkDistrictCouncil.py +108 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NorthNorthamptonshireCouncil.py +72 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NorthSomersetCouncil.py +76 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NorthTynesideCouncil.py +220 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NorthWestLeicestershire.py +114 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NorthYorkshire.py +58 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NorthumberlandCouncil.py +123 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/NottinghamCityCouncil.py +36 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/OldhamCouncil.py +51 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/PortsmouthCityCouncil.py +131 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/PrestonCityCouncil.py +97 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/ReadingBoroughCouncil.py +30 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/ReigateAndBansteadBoroughCouncil.py +81 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/RenfrewshireCouncil.py +135 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/RhonddaCynonTaffCouncil.py +80 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/RochdaleCouncil.py +69 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/RochfordCouncil.py +60 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/RugbyBoroughCouncil.py +93 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/RushcliffeBoroughCouncil.py +100 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/RushmoorCouncil.py +81 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SalfordCityCouncil.py +70 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SevenoaksDistrictCouncil.py +106 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SheffieldCityCouncil.py +54 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/ShropshireCouncil.py +45 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SolihullCouncil.py +48 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SomersetCouncil.py +203 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SouthAyrshireCouncil.py +73 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SouthCambridgeshireCouncil.py +65 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SouthGloucestershireCouncil.py +74 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SouthLanarkshireCouncil.py +78 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SouthNorfolkCouncil.py +91 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SouthOxfordshireCouncil.py +93 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SouthTynesideCouncil.py +98 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/StAlbansCityAndDistrictCouncil.py +43 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/StHelensBC.py +56 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/StaffordshireMoorlandsDistrictCouncil.py +112 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/StockportBoroughCouncil.py +39 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/StokeOnTrentCityCouncil.py +79 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/StratfordUponAvonCouncil.py +94 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SunderlandCityCouncil.py +100 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/SwaleBoroughCouncil.py +52 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/TamesideMBCouncil.py +62 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/TandridgeDistrictCouncil.py +60 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/TelfordAndWrekinCouncil.py +50 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/TestValleyBoroughCouncil.py +203 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/TonbridgeAndMallingBC.py +101 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/TorbayCouncil.py +51 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/TorridgeDistrictCouncil.py +154 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/ValeofGlamorganCouncil.py +119 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/ValeofWhiteHorseCouncil.py +103 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WakefieldCityCouncil.py +89 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WarwickDistrictCouncil.py +34 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WaverleyBoroughCouncil.py +119 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WealdenDistrictCouncil.py +86 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WelhatCouncil.py +73 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WestBerkshireCouncil.py +134 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WestLindseyDistrictCouncil.py +118 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WestLothianCouncil.py +103 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WestNorthamptonshireCouncil.py +34 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WestSuffolkCouncil.py +64 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WiganBoroughCouncil.py +97 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WiltshireCouncil.py +135 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WindsorAndMaidenheadCouncil.py +134 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WokingBoroughCouncil.py +114 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/WyreCouncil.py +89 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/YorkCouncil.py +45 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/councils/council_class_template/councilclasstemplate.py +33 -0
- uk_bin_collection-0.74.0/uk_bin_collection/uk_bin_collection/get_bin_data.py +165 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2022 Robert Bradley
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,247 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: uk_bin_collection
|
3
|
+
Version: 0.74.0
|
4
|
+
Summary: Python Lib to collect UK Bin Data
|
5
|
+
Author: Robert Bradley
|
6
|
+
Author-email: robbrad182@gmail.com
|
7
|
+
Requires-Python: >=3.11
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
11
|
+
Requires-Dist: bs4
|
12
|
+
Requires-Dist: holidays
|
13
|
+
Requires-Dist: lxml
|
14
|
+
Requires-Dist: pandas
|
15
|
+
Requires-Dist: python-dateutil
|
16
|
+
Requires-Dist: requests
|
17
|
+
Requires-Dist: selenium
|
18
|
+
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
|
19
|
+
Requires-Dist: urllib3
|
20
|
+
Requires-Dist: webdriver-manager (>=4.0.1,<5.0.0)
|
21
|
+
Project-URL: issues, https://github.com/robbrad/UKBinCollectionData/issues
|
22
|
+
Description-Content-Type: text/markdown
|
23
|
+
|
24
|
+
[](https://www.python.org)
|
25
|
+
|
26
|
+
[](https://github.com/robbrad/UKBinCollectionData)
|
27
|
+
[](https://github.com/robbrad/UKBinCollectionData/releases)
|
28
|
+
[](https://pypi.org/project/uk-bin-collection/)
|
29
|
+
|
30
|
+
[](https://github.com/robbrad/UKBinCollectionData/blob/master/LICENSE)
|
31
|
+
[](https://github.com/robbrad/UKBinCollectionData/issues?q=is%3Aopen+is%3Aissue)
|
32
|
+
[](https://github.com/robbrad/UKBinCollectionData/issues?q=is%3Aissue+is%3Aclosed)
|
33
|
+
[](https://github.com/robbrad/UKBinCollectionData/graphs/contributors)
|
34
|
+
|
35
|
+
[](https://github.com/robbrad/UKBinCollectionData/actions/workflows/behave.yml)
|
36
|
+

|
37
|
+
[](https://github.com/robbrad/UKBinCollectionData/actions/workflows/codeql-analysis.yml)
|
38
|
+
[](https://github.com/robbrad/UKBinCollectionData/actions/workflows/release.yml)
|
39
|
+
[](https://github.com/robbrad/UKBinCollectionData/actions/workflows/pages/pages-build-deployment)
|
40
|
+
|
41
|
+
# UK Bin Collection Data (UKBCD)
|
42
|
+
This project aims to provide a neat and standard way of providing bin collection data in JSON format from UK councils that have no API to do so.
|
43
|
+
|
44
|
+
Why do this?
|
45
|
+
You might want to use this in a Home Automation - for example say you had an LED bar that lit up on the day of bin collection to the colour of the bin you want to take out, then this repo provides the data for that.
|
46
|
+
|
47
|
+
**PLEASE respect a councils infrastructure / usage policy and only collect data for your own personal use on a suitable frequency to your collection schedule.**
|
48
|
+
|
49
|
+
Most scripts make use of [Beautiful Soup 4](https://pypi.org/project/beautifulsoup4/) to scrape data, although others use different approaches, such as emulating web browser behaviour, or reading data from CSV files.
|
50
|
+
|
51
|
+
[](https://community.home-assistant.io/t/bin-waste-collection/55451)
|
52
|
+
[](https://github.com/robbrad/UKBinCollectionData/issues/new/choose)
|
53
|
+
|
54
|
+
---
|
55
|
+
|
56
|
+
## Home Assistant Usage
|
57
|
+
|
58
|
+
### Install with HACS (recommended)
|
59
|
+
|
60
|
+
1. Ensure you have [HACS](https://hacs.xyz/) installed
|
61
|
+
1. In the Home Assistant UI go to `HACS` > `Integrations` > `⋮` > `Custom repositories`.
|
62
|
+
1. Enter `https://github.com/robbrad/UKBinCollectionData` in the `Repository` field.
|
63
|
+
1. Select `Integration` as the category then click `ADD`.
|
64
|
+
1. Click `+ Add Integration` and search for and select `UK Bin Collection Data` then click `Download`.
|
65
|
+
1. Restart your Home Assistant.
|
66
|
+
1. In the Home Assistant UI go to `Settings` > `Devices & Services` click `+ Add Integration` and search for `UK Bin Collection Data`.
|
67
|
+
1. If your see a "URL of the remote Selenium web driver to use" field when setting up your council, you'll need to provide the URL to a web driver you've set up seperately such as [standalone-chrome](https://hub.docker.com/r/selenium/standalone-chrome).
|
68
|
+
|
69
|
+
### Install manually
|
70
|
+
|
71
|
+
1. Open the folder for your Home Assistant configuration (where you find `configuration.yaml`).
|
72
|
+
1. If you do not have a `custom_components` folder there, you need to create it.
|
73
|
+
1. [Download](https://github.com/robbrad/UKBinCollectionData/archive/refs/heads/master.zip) this repository then copy the folder `custom_components/uk_bin_collection` into the `custom_components` folder you found/created in the previous step.
|
74
|
+
1. Restart your Home Assistant.
|
75
|
+
1. In the Home Assistant UI go to `Settings` > `Devices & Services` click `+ Add Integration` and search for `UK Bin Collection Data`.
|
76
|
+
|
77
|
+
---
|
78
|
+
|
79
|
+
## Standalone Usage
|
80
|
+
```commandline
|
81
|
+
PS G:\Projects\Python\UKBinCollectionData\uk_bin_collection\collect_data.py
|
82
|
+
usage: collect_data.py [-h] [-p POSTCODE] [-n NUMBER] [-u UPRN] module URL
|
83
|
+
|
84
|
+
positional arguments:
|
85
|
+
module Name of council module to use (required)
|
86
|
+
URL URL to parse (required)
|
87
|
+
|
88
|
+
options:
|
89
|
+
-h, --help show this help message (optional)
|
90
|
+
-p POSTCODE, --postcode POSTCODE Postcode to parse - should include (optional)
|
91
|
+
a space and be wrapped in double
|
92
|
+
quotes
|
93
|
+
-n NUMBER, --number NUMBER House number to parse (optional)
|
94
|
+
-u UPRN, --uprn UPRN UPRN to parse (optional)
|
95
|
+
```
|
96
|
+
|
97
|
+
### Quickstart
|
98
|
+
The basic command to execute a script is:
|
99
|
+
```commandline
|
100
|
+
python collect_data.py <council_name> "<collection_url>"
|
101
|
+
```
|
102
|
+
where ```council_name``` is the name of the council's .py script (without the .py) and ```collection_url``` is the URL to scrape.
|
103
|
+
The help documentation refers to these as "module" and "URL", respectively. Supported council scripts can be found in the `uk_bin_collection/uk_bin_collection/councils` folder.
|
104
|
+
|
105
|
+
Some scripts require additional parameters, for example, when a UPRN is not passed in a URL, or when the script is not scraping a web page.
|
106
|
+
For example, the Leeds City Council script needs two additional parameters - a postcode, and a house number. This is done like so:
|
107
|
+
|
108
|
+
```commandline
|
109
|
+
python collect_data.py LeedsCityCouncil https://www.leeds.gov.uk/residents/bins-and-recycling/check-your-bin-day -p "LS1 2JG" -n 41
|
110
|
+
```
|
111
|
+
- A **postcode** can be passed with `-p "postcode"` or `--postcode "postcode"`. The postcode must always include a space in the middle and
|
112
|
+
be wrapped in double quotes (due to how command line arguments are handled).
|
113
|
+
- A **house number** can be passed with `-n number` or `--number number`.
|
114
|
+
- A **UPRN reference** can be passed with `-u uprn` or `--uprn uprn`.
|
115
|
+
|
116
|
+
To check the parameters needed for your council's script, please check the [project wiki](https://github.com/robbrad/UKBinCollectionData/wiki) for more information.
|
117
|
+
|
118
|
+
|
119
|
+
### Project dependencies
|
120
|
+
Some scripts rely on external packages to function. A list of required scripts for both development and execution can be found in the project's [PROJECT_TOML](https://github.com/robbrad/UKBinCollectionData/blob/feature/%2353_integration_tests/pyproject.toml)
|
121
|
+
Install can be done via
|
122
|
+
`poetry install` from within the root of the repo.
|
123
|
+
|
124
|
+
---
|
125
|
+
|
126
|
+
## UPRN Finder
|
127
|
+
Some councils make use of the UPRN (Unique property reference number) to identify your property. You can find yours [here](https://www.findmyaddress.co.uk/search) or [here](https://uprn.uk/).
|
128
|
+
|
129
|
+
---
|
130
|
+
|
131
|
+
## Requesting your council
|
132
|
+
To make a request for your council, first check the [Issues](https://github.com/robbrad/UKBinCollectionData/issues) page to make sure it has not already been requested. If not, please fill in a new [Council Request](https://github.com/robbrad/UKBinCollectionData/issues/new/choose) form, including as much information as possible, including:
|
133
|
+
- Name of the council
|
134
|
+
- URL to bin collections
|
135
|
+
- An example postcode and/or UPRN (whichever is relevant)
|
136
|
+
- Any further information
|
137
|
+
|
138
|
+
Please be aware that this project is run by volunteer contributors and completion depends on numerous factors - even with a request, we cannot guarantee if/when your council will get a script.
|
139
|
+
|
140
|
+
---
|
141
|
+
|
142
|
+
## Reports
|
143
|
+
|
144
|
+
- [3.11](https://robbrad.github.io/UKBinCollectionData/3.11/)
|
145
|
+
- [3.12](https://robbrad.github.io/UKBinCollectionData/3.12/)
|
146
|
+
|
147
|
+
---
|
148
|
+
## Docker API Server
|
149
|
+
We have created an API for this located under [uk_bin_collection_api_server](https://github.com/robbrad/UKBinCollectionData/uk_bin_collection_api_server)
|
150
|
+
|
151
|
+
### Prerequisites
|
152
|
+
|
153
|
+
- Docker installed on your machine
|
154
|
+
- Python (if you plan to run the API locally without Docker)
|
155
|
+
|
156
|
+
### Running the API with Docker
|
157
|
+
|
158
|
+
1. Clone this repository.
|
159
|
+
2. Navigate to the uk_bin_collection_api_server directory of the project.
|
160
|
+
|
161
|
+
#### Build the Docker Container
|
162
|
+
|
163
|
+
```bash
|
164
|
+
docker build -t ukbc_api_server .
|
165
|
+
```
|
166
|
+
|
167
|
+
```
|
168
|
+
docker run -p 8080:8080 ukbc_api_server
|
169
|
+
```
|
170
|
+
|
171
|
+
#### Accessing the API
|
172
|
+
|
173
|
+
Once the Docker container is running, you can access the API endpoints:
|
174
|
+
|
175
|
+
API Base URL: http://localhost:8080/api
|
176
|
+
Swagger UI: http://localhost:8080/api/ui/
|
177
|
+
|
178
|
+
#### API Documentation
|
179
|
+
|
180
|
+
The API documentation can be accessed via the Swagger UI. Use the Swagger UI to explore available endpoints, test different requests, and understand the API functionalities.
|
181
|
+
|
182
|
+

|
183
|
+
|
184
|
+
#### API Endpoints
|
185
|
+
`GET /bin_collection/{council}`
|
186
|
+
|
187
|
+
Description: Retrieves information about bin collection for the specified council.
|
188
|
+
|
189
|
+
Parameters:
|
190
|
+
|
191
|
+
council (required): Name of the council.
|
192
|
+
Other optional parameters: [Specify optional parameters if any]
|
193
|
+
|
194
|
+
Example Request:
|
195
|
+
|
196
|
+
```bash
|
197
|
+
curl -X GET "http://localhost:8080/api/bin_collection/{council}" -H "accept: application/json"
|
198
|
+
```
|
199
|
+
|
200
|
+
## Docker Compose
|
201
|
+
This includes the Selenium standalone-chrome for Selenium based councils
|
202
|
+
|
203
|
+
```
|
204
|
+
version: '3'
|
205
|
+
|
206
|
+
services:
|
207
|
+
ukbc_api_server:
|
208
|
+
build:
|
209
|
+
context: .
|
210
|
+
dockerfile: Dockerfile
|
211
|
+
ports:
|
212
|
+
- "8080:8080" # Adjust the ports as needed
|
213
|
+
depends_on:
|
214
|
+
- selenium
|
215
|
+
|
216
|
+
selenium:
|
217
|
+
image: selenium/standalone-chrome:latest
|
218
|
+
ports:
|
219
|
+
- "4444:4444"
|
220
|
+
|
221
|
+
```
|
222
|
+
### Run with
|
223
|
+
```bash
|
224
|
+
sudo apt-get update
|
225
|
+
sudo apt-get install docker-compose
|
226
|
+
|
227
|
+
docker-compose up
|
228
|
+
```
|
229
|
+
|
230
|
+
---
|
231
|
+
|
232
|
+
## FAQ
|
233
|
+
#### I've got an issue/support question - what do I do?
|
234
|
+
Please post in the [HomeAssistant thread](https://community.home-assistant.io/t/bin-waste-collection/55451) or raise a new (non council request) [issue](https://github.com/robbrad/UKBinCollectionData/issues/new).
|
235
|
+
|
236
|
+
#### I'd like to contribute, where do I start?
|
237
|
+
Contributions are always welcome! See ```CONTRIBUTING.md``` to get started. Please adhere to the project's [code of conduct](https://github.com/robbrad/UKBinCollectionData/blob/master/CODE_OF_CONDUCT.md).
|
238
|
+
|
239
|
+
- If you're new to coding/Python/BeautifulSoup, feel free to check [here](https://github.com/robbrad/UKBinCollectionData/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) for issues that are good for newcomers!
|
240
|
+
- If you would like to try writing your own scraper, feel free to fork this project and use existing scrapers as a base for your approach (or `councilclasstemplate.py`).
|
241
|
+
|
242
|
+
## Contributors
|
243
|
+
<a href="https://github.com/robbrad/UKBinCollectionData/graphs/contributors">
|
244
|
+
<img src="https://contrib.rocks/image?repo=robbrad/UKBinCollectionData" alt="Image of contributors"/>
|
245
|
+
</a>
|
246
|
+
|
247
|
+
|
@@ -0,0 +1,223 @@
|
|
1
|
+
[](https://www.python.org)
|
2
|
+
|
3
|
+
[](https://github.com/robbrad/UKBinCollectionData)
|
4
|
+
[](https://github.com/robbrad/UKBinCollectionData/releases)
|
5
|
+
[](https://pypi.org/project/uk-bin-collection/)
|
6
|
+
|
7
|
+
[](https://github.com/robbrad/UKBinCollectionData/blob/master/LICENSE)
|
8
|
+
[](https://github.com/robbrad/UKBinCollectionData/issues?q=is%3Aopen+is%3Aissue)
|
9
|
+
[](https://github.com/robbrad/UKBinCollectionData/issues?q=is%3Aissue+is%3Aclosed)
|
10
|
+
[](https://github.com/robbrad/UKBinCollectionData/graphs/contributors)
|
11
|
+
|
12
|
+
[](https://github.com/robbrad/UKBinCollectionData/actions/workflows/behave.yml)
|
13
|
+

|
14
|
+
[](https://github.com/robbrad/UKBinCollectionData/actions/workflows/codeql-analysis.yml)
|
15
|
+
[](https://github.com/robbrad/UKBinCollectionData/actions/workflows/release.yml)
|
16
|
+
[](https://github.com/robbrad/UKBinCollectionData/actions/workflows/pages/pages-build-deployment)
|
17
|
+
|
18
|
+
# UK Bin Collection Data (UKBCD)
|
19
|
+
This project aims to provide a neat and standard way of providing bin collection data in JSON format from UK councils that have no API to do so.
|
20
|
+
|
21
|
+
Why do this?
|
22
|
+
You might want to use this in a Home Automation - for example say you had an LED bar that lit up on the day of bin collection to the colour of the bin you want to take out, then this repo provides the data for that.
|
23
|
+
|
24
|
+
**PLEASE respect a councils infrastructure / usage policy and only collect data for your own personal use on a suitable frequency to your collection schedule.**
|
25
|
+
|
26
|
+
Most scripts make use of [Beautiful Soup 4](https://pypi.org/project/beautifulsoup4/) to scrape data, although others use different approaches, such as emulating web browser behaviour, or reading data from CSV files.
|
27
|
+
|
28
|
+
[](https://community.home-assistant.io/t/bin-waste-collection/55451)
|
29
|
+
[](https://github.com/robbrad/UKBinCollectionData/issues/new/choose)
|
30
|
+
|
31
|
+
---
|
32
|
+
|
33
|
+
## Home Assistant Usage
|
34
|
+
|
35
|
+
### Install with HACS (recommended)
|
36
|
+
|
37
|
+
1. Ensure you have [HACS](https://hacs.xyz/) installed
|
38
|
+
1. In the Home Assistant UI go to `HACS` > `Integrations` > `⋮` > `Custom repositories`.
|
39
|
+
1. Enter `https://github.com/robbrad/UKBinCollectionData` in the `Repository` field.
|
40
|
+
1. Select `Integration` as the category then click `ADD`.
|
41
|
+
1. Click `+ Add Integration` and search for and select `UK Bin Collection Data` then click `Download`.
|
42
|
+
1. Restart your Home Assistant.
|
43
|
+
1. In the Home Assistant UI go to `Settings` > `Devices & Services` click `+ Add Integration` and search for `UK Bin Collection Data`.
|
44
|
+
1. If your see a "URL of the remote Selenium web driver to use" field when setting up your council, you'll need to provide the URL to a web driver you've set up seperately such as [standalone-chrome](https://hub.docker.com/r/selenium/standalone-chrome).
|
45
|
+
|
46
|
+
### Install manually
|
47
|
+
|
48
|
+
1. Open the folder for your Home Assistant configuration (where you find `configuration.yaml`).
|
49
|
+
1. If you do not have a `custom_components` folder there, you need to create it.
|
50
|
+
1. [Download](https://github.com/robbrad/UKBinCollectionData/archive/refs/heads/master.zip) this repository then copy the folder `custom_components/uk_bin_collection` into the `custom_components` folder you found/created in the previous step.
|
51
|
+
1. Restart your Home Assistant.
|
52
|
+
1. In the Home Assistant UI go to `Settings` > `Devices & Services` click `+ Add Integration` and search for `UK Bin Collection Data`.
|
53
|
+
|
54
|
+
---
|
55
|
+
|
56
|
+
## Standalone Usage
|
57
|
+
```commandline
|
58
|
+
PS G:\Projects\Python\UKBinCollectionData\uk_bin_collection\collect_data.py
|
59
|
+
usage: collect_data.py [-h] [-p POSTCODE] [-n NUMBER] [-u UPRN] module URL
|
60
|
+
|
61
|
+
positional arguments:
|
62
|
+
module Name of council module to use (required)
|
63
|
+
URL URL to parse (required)
|
64
|
+
|
65
|
+
options:
|
66
|
+
-h, --help show this help message (optional)
|
67
|
+
-p POSTCODE, --postcode POSTCODE Postcode to parse - should include (optional)
|
68
|
+
a space and be wrapped in double
|
69
|
+
quotes
|
70
|
+
-n NUMBER, --number NUMBER House number to parse (optional)
|
71
|
+
-u UPRN, --uprn UPRN UPRN to parse (optional)
|
72
|
+
```
|
73
|
+
|
74
|
+
### Quickstart
|
75
|
+
The basic command to execute a script is:
|
76
|
+
```commandline
|
77
|
+
python collect_data.py <council_name> "<collection_url>"
|
78
|
+
```
|
79
|
+
where ```council_name``` is the name of the council's .py script (without the .py) and ```collection_url``` is the URL to scrape.
|
80
|
+
The help documentation refers to these as "module" and "URL", respectively. Supported council scripts can be found in the `uk_bin_collection/uk_bin_collection/councils` folder.
|
81
|
+
|
82
|
+
Some scripts require additional parameters, for example, when a UPRN is not passed in a URL, or when the script is not scraping a web page.
|
83
|
+
For example, the Leeds City Council script needs two additional parameters - a postcode, and a house number. This is done like so:
|
84
|
+
|
85
|
+
```commandline
|
86
|
+
python collect_data.py LeedsCityCouncil https://www.leeds.gov.uk/residents/bins-and-recycling/check-your-bin-day -p "LS1 2JG" -n 41
|
87
|
+
```
|
88
|
+
- A **postcode** can be passed with `-p "postcode"` or `--postcode "postcode"`. The postcode must always include a space in the middle and
|
89
|
+
be wrapped in double quotes (due to how command line arguments are handled).
|
90
|
+
- A **house number** can be passed with `-n number` or `--number number`.
|
91
|
+
- A **UPRN reference** can be passed with `-u uprn` or `--uprn uprn`.
|
92
|
+
|
93
|
+
To check the parameters needed for your council's script, please check the [project wiki](https://github.com/robbrad/UKBinCollectionData/wiki) for more information.
|
94
|
+
|
95
|
+
|
96
|
+
### Project dependencies
|
97
|
+
Some scripts rely on external packages to function. A list of required scripts for both development and execution can be found in the project's [PROJECT_TOML](https://github.com/robbrad/UKBinCollectionData/blob/feature/%2353_integration_tests/pyproject.toml)
|
98
|
+
Install can be done via
|
99
|
+
`poetry install` from within the root of the repo.
|
100
|
+
|
101
|
+
---
|
102
|
+
|
103
|
+
## UPRN Finder
|
104
|
+
Some councils make use of the UPRN (Unique property reference number) to identify your property. You can find yours [here](https://www.findmyaddress.co.uk/search) or [here](https://uprn.uk/).
|
105
|
+
|
106
|
+
---
|
107
|
+
|
108
|
+
## Requesting your council
|
109
|
+
To make a request for your council, first check the [Issues](https://github.com/robbrad/UKBinCollectionData/issues) page to make sure it has not already been requested. If not, please fill in a new [Council Request](https://github.com/robbrad/UKBinCollectionData/issues/new/choose) form, including as much information as possible, including:
|
110
|
+
- Name of the council
|
111
|
+
- URL to bin collections
|
112
|
+
- An example postcode and/or UPRN (whichever is relevant)
|
113
|
+
- Any further information
|
114
|
+
|
115
|
+
Please be aware that this project is run by volunteer contributors and completion depends on numerous factors - even with a request, we cannot guarantee if/when your council will get a script.
|
116
|
+
|
117
|
+
---
|
118
|
+
|
119
|
+
## Reports
|
120
|
+
|
121
|
+
- [3.11](https://robbrad.github.io/UKBinCollectionData/3.11/)
|
122
|
+
- [3.12](https://robbrad.github.io/UKBinCollectionData/3.12/)
|
123
|
+
|
124
|
+
---
|
125
|
+
## Docker API Server
|
126
|
+
We have created an API for this located under [uk_bin_collection_api_server](https://github.com/robbrad/UKBinCollectionData/uk_bin_collection_api_server)
|
127
|
+
|
128
|
+
### Prerequisites
|
129
|
+
|
130
|
+
- Docker installed on your machine
|
131
|
+
- Python (if you plan to run the API locally without Docker)
|
132
|
+
|
133
|
+
### Running the API with Docker
|
134
|
+
|
135
|
+
1. Clone this repository.
|
136
|
+
2. Navigate to the uk_bin_collection_api_server directory of the project.
|
137
|
+
|
138
|
+
#### Build the Docker Container
|
139
|
+
|
140
|
+
```bash
|
141
|
+
docker build -t ukbc_api_server .
|
142
|
+
```
|
143
|
+
|
144
|
+
```
|
145
|
+
docker run -p 8080:8080 ukbc_api_server
|
146
|
+
```
|
147
|
+
|
148
|
+
#### Accessing the API
|
149
|
+
|
150
|
+
Once the Docker container is running, you can access the API endpoints:
|
151
|
+
|
152
|
+
API Base URL: http://localhost:8080/api
|
153
|
+
Swagger UI: http://localhost:8080/api/ui/
|
154
|
+
|
155
|
+
#### API Documentation
|
156
|
+
|
157
|
+
The API documentation can be accessed via the Swagger UI. Use the Swagger UI to explore available endpoints, test different requests, and understand the API functionalities.
|
158
|
+
|
159
|
+

|
160
|
+
|
161
|
+
#### API Endpoints
|
162
|
+
`GET /bin_collection/{council}`
|
163
|
+
|
164
|
+
Description: Retrieves information about bin collection for the specified council.
|
165
|
+
|
166
|
+
Parameters:
|
167
|
+
|
168
|
+
council (required): Name of the council.
|
169
|
+
Other optional parameters: [Specify optional parameters if any]
|
170
|
+
|
171
|
+
Example Request:
|
172
|
+
|
173
|
+
```bash
|
174
|
+
curl -X GET "http://localhost:8080/api/bin_collection/{council}" -H "accept: application/json"
|
175
|
+
```
|
176
|
+
|
177
|
+
## Docker Compose
|
178
|
+
This includes the Selenium standalone-chrome for Selenium based councils
|
179
|
+
|
180
|
+
```
|
181
|
+
version: '3'
|
182
|
+
|
183
|
+
services:
|
184
|
+
ukbc_api_server:
|
185
|
+
build:
|
186
|
+
context: .
|
187
|
+
dockerfile: Dockerfile
|
188
|
+
ports:
|
189
|
+
- "8080:8080" # Adjust the ports as needed
|
190
|
+
depends_on:
|
191
|
+
- selenium
|
192
|
+
|
193
|
+
selenium:
|
194
|
+
image: selenium/standalone-chrome:latest
|
195
|
+
ports:
|
196
|
+
- "4444:4444"
|
197
|
+
|
198
|
+
```
|
199
|
+
### Run with
|
200
|
+
```bash
|
201
|
+
sudo apt-get update
|
202
|
+
sudo apt-get install docker-compose
|
203
|
+
|
204
|
+
docker-compose up
|
205
|
+
```
|
206
|
+
|
207
|
+
---
|
208
|
+
|
209
|
+
## FAQ
|
210
|
+
#### I've got an issue/support question - what do I do?
|
211
|
+
Please post in the [HomeAssistant thread](https://community.home-assistant.io/t/bin-waste-collection/55451) or raise a new (non council request) [issue](https://github.com/robbrad/UKBinCollectionData/issues/new).
|
212
|
+
|
213
|
+
#### I'd like to contribute, where do I start?
|
214
|
+
Contributions are always welcome! See ```CONTRIBUTING.md``` to get started. Please adhere to the project's [code of conduct](https://github.com/robbrad/UKBinCollectionData/blob/master/CODE_OF_CONDUCT.md).
|
215
|
+
|
216
|
+
- If you're new to coding/Python/BeautifulSoup, feel free to check [here](https://github.com/robbrad/UKBinCollectionData/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) for issues that are good for newcomers!
|
217
|
+
- If you would like to try writing your own scraper, feel free to fork this project and use existing scrapers as a base for your approach (or `councilclasstemplate.py`).
|
218
|
+
|
219
|
+
## Contributors
|
220
|
+
<a href="https://github.com/robbrad/UKBinCollectionData/graphs/contributors">
|
221
|
+
<img src="https://contrib.rocks/image?repo=robbrad/UKBinCollectionData" alt="Image of contributors"/>
|
222
|
+
</a>
|
223
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
[tool.poetry]
|
2
|
+
name = "uk_bin_collection"
|
3
|
+
version = "0.74.0"
|
4
|
+
description = "Python Lib to collect UK Bin Data"
|
5
|
+
readme = "README.md"
|
6
|
+
authors = ["Robert Bradley <robbrad182@gmail.com>"]
|
7
|
+
packages = [
|
8
|
+
{ include = "uk_bin_collection", from = "." },
|
9
|
+
]
|
10
|
+
include = ["uk_bin_collection"]
|
11
|
+
|
12
|
+
[tool.pytest.ini_options]
|
13
|
+
pythonpath = [
|
14
|
+
".", "uk_bin_collection"
|
15
|
+
]
|
16
|
+
|
17
|
+
[tool.flit.metadata]
|
18
|
+
module = "uk_bin_collection"
|
19
|
+
|
20
|
+
[tool.poetry.urls]
|
21
|
+
issues = "https://github.com/robbrad/UKBinCollectionData/issues"
|
22
|
+
|
23
|
+
[build-system]
|
24
|
+
requires = ["poetry-core>=1.2.0"]
|
25
|
+
build-backend = "poetry.core.masonry.api"
|
26
|
+
|
27
|
+
[tool.poetry.dev-dependencies]
|
28
|
+
black = "*"
|
29
|
+
coverage = "*"
|
30
|
+
flake8 = "*"
|
31
|
+
jsonschema = "*"
|
32
|
+
pylint = "*"
|
33
|
+
pytest = "*"
|
34
|
+
setuptools = "*"
|
35
|
+
pytest-bdd = "*"
|
36
|
+
allure-pytest-bdd = "*"
|
37
|
+
pytest-xdist = {extras = ["psutil"], version = "*"}
|
38
|
+
pyhamcrest = "*"
|
39
|
+
tabulate = "^0.9.0"
|
40
|
+
|
41
|
+
[tool.poetry.scripts]
|
42
|
+
uk_bin_collection = "uk_bin_collection.uk_bin_collection.collect_data:run"
|
43
|
+
|
44
|
+
[tool.dephell.main]
|
45
|
+
versioning = "semver"
|
46
|
+
from = {format = "poetrylock", path = "poetry.lock"}
|
47
|
+
envs = ["main"]
|
48
|
+
to = {format = "poetry", path = "pyproject.toml"}
|
49
|
+
|
50
|
+
[tool.poetry.dependencies]
|
51
|
+
bs4 = "*"
|
52
|
+
python-dateutil = "*"
|
53
|
+
holidays = "*"
|
54
|
+
pandas = "*"
|
55
|
+
python = ">=3.11"
|
56
|
+
requests = "*"
|
57
|
+
selenium = "*"
|
58
|
+
lxml = "*"
|
59
|
+
urllib3 = "*"
|
60
|
+
webdriver-manager = "^4.0.1"
|
61
|
+
tabulate = "^0.9.0"
|
62
|
+
|
63
|
+
[tool.commitizen]
|
64
|
+
major_version_zero = true
|
65
|
+
version_provider = "poetry"
|
66
|
+
version_scheme = "semver"
|
67
|
+
version_files = [
|
68
|
+
"custom_components/uk_bin_collection/manifest.json:version",
|
69
|
+
"custom_components/uk_bin_collection/manifest.json:requirements",
|
70
|
+
"custom_components/uk_bin_collection/config_flow.py:githubusercontent"
|
71
|
+
]
|
72
|
+
|
File without changes
|
@@ -0,0 +1,79 @@
|
|
1
|
+
import json
|
2
|
+
import re
|
3
|
+
import requests
|
4
|
+
import sys
|
5
|
+
from tabulate import tabulate
|
6
|
+
|
7
|
+
def get_councils_from_files(branch):
|
8
|
+
url = f"https://api.github.com/repos/robbrad/UKBinCollectionData/contents/uk_bin_collection/uk_bin_collection/councils?ref={branch}"
|
9
|
+
response = requests.get(url)
|
10
|
+
data = response.json()
|
11
|
+
return [item['name'].replace('.py', '') for item in data if item['name'].endswith('.py')]
|
12
|
+
|
13
|
+
def get_councils_from_json(branch):
|
14
|
+
url = f"https://raw.githubusercontent.com/robbrad/UKBinCollectionData/{branch}/uk_bin_collection/tests/input.json"
|
15
|
+
response = requests.get(url)
|
16
|
+
data = json.loads(response.text)
|
17
|
+
return list(data.keys())
|
18
|
+
|
19
|
+
def get_councils_from_features(branch):
|
20
|
+
url = f"https://raw.githubusercontent.com/robbrad/UKBinCollectionData/{branch}/uk_bin_collection/tests/features/validate_council_outputs.feature"
|
21
|
+
response = requests.get(url)
|
22
|
+
content = response.text
|
23
|
+
return re.findall(r'Examples:\s+(\w+)', content)
|
24
|
+
|
25
|
+
def compare_councils(councils1, councils2, councils3):
|
26
|
+
set1 = set(councils1)
|
27
|
+
set2 = set(councils2)
|
28
|
+
set3 = set(councils3)
|
29
|
+
all_councils = set1 | set2 | set3
|
30
|
+
all_council_data = {}
|
31
|
+
discrepancies_found = False
|
32
|
+
for council in all_councils:
|
33
|
+
in_files = council in set1
|
34
|
+
in_json = council in set2
|
35
|
+
in_features = council in set3
|
36
|
+
discrepancies_count = [in_files, in_json, in_features].count(False)
|
37
|
+
all_council_data[council] = {
|
38
|
+
'in_files': in_files,
|
39
|
+
'in_json': in_json,
|
40
|
+
'in_features': in_features,
|
41
|
+
'discrepancies_count': discrepancies_count
|
42
|
+
}
|
43
|
+
if discrepancies_count > 0:
|
44
|
+
discrepancies_found = True
|
45
|
+
return all_council_data, discrepancies_found
|
46
|
+
|
47
|
+
def main(branch="master"):
|
48
|
+
# Execute and print the comparison
|
49
|
+
file_councils = get_councils_from_files(branch)
|
50
|
+
json_councils = get_councils_from_json(branch)
|
51
|
+
feature_councils = get_councils_from_features(branch)
|
52
|
+
|
53
|
+
all_councils_data, discrepancies_found = compare_councils(file_councils, json_councils, feature_councils)
|
54
|
+
|
55
|
+
# Create a list of lists for tabulate, sort by discrepancies count and then by name
|
56
|
+
table_data = []
|
57
|
+
headers = ["Council Name", "In Files", "In JSON", "In Features", "Discrepancies"]
|
58
|
+
for council, presence in sorted(all_councils_data.items(), key=lambda x: (x[1]['discrepancies_count'], x[0])):
|
59
|
+
row = [
|
60
|
+
council,
|
61
|
+
"✔" if presence['in_files'] else "✘",
|
62
|
+
"✔" if presence['in_json'] else "✘",
|
63
|
+
"✔" if presence['in_features'] else "✘",
|
64
|
+
presence['discrepancies_count']
|
65
|
+
]
|
66
|
+
table_data.append(row)
|
67
|
+
|
68
|
+
# Print the table using tabulate
|
69
|
+
print(tabulate(table_data, headers=headers, tablefmt='grid'))
|
70
|
+
|
71
|
+
if discrepancies_found:
|
72
|
+
print("Discrepancies found! Failing the workflow.")
|
73
|
+
sys.exit(1)
|
74
|
+
else:
|
75
|
+
print("No discrepancies found. Workflow successful.")
|
76
|
+
|
77
|
+
if __name__ == "__main__":
|
78
|
+
branch = sys.argv[1] if len(sys.argv) > 1 else "master"
|
79
|
+
main(branch)
|