From 8a5a7cb9bf8c79443734e0991743f7e2044bdaf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20M=C3=A5rdestam?= Date: Wed, 17 Jul 2024 17:42:13 +0200 Subject: [PATCH] Add edpevent and merge SSAM and Uppsalavatten (#2281) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add edpevent and merge SSAM and Uppsalavatten This follows a discussion on pull request #2261 * Revert "Add edpevent and merge SSAM and Uppsalavatten" This reverts commit 4e3b88e842954856751a04b7fb1b042c2cf24e3f. * Add support for doc generator for edpevent multiple sources * Add edpevent source This is a multi source for all that use edpevent. As of this commit that includes: - Boden - Uppsala Vatten - SSAM - Skellefteå * Deprecate SSAM and Uppsala Vatten * reformatting --------- Co-authored-by: 5ila5 <5ila5@users.noreply.github.com> --- README.md | 5 + .../waste_collection_schedule/sources.json | 33 +++ .../translations/en.json | 6 +- .../source/edpevent_se.py | 229 ++++++++++++++++++ .../source/ssam_se.py | 103 +------- .../source/uppsalavatten_se.py | 89 +------ doc/source/edpevent_se.md | 94 +++++++ doc/source/ssam_se.md | 4 +- doc/source/uppsalavatten_se.md | 4 +- info.md | 2 +- update_docu_links.py | 15 +- 11 files changed, 407 insertions(+), 177 deletions(-) create mode 100644 custom_components/waste_collection_schedule/waste_collection_schedule/source/edpevent_se.py create mode 100644 doc/source/edpevent_se.md diff --git a/README.md b/README.md index 24cf6812d..7907d9351 100644 --- a/README.md +++ b/README.md @@ -1203,6 +1203,8 @@ Waste collection schedules in the following formats and countries are supported. Sweden - [Affärsverken](/doc/source/affarsverken_se.md) / affarsverken.se +- [Boden](/doc/source/edpevent_se.md) / boden.se +- [EDPEvent - Multi Source](/doc/source/edpevent_se.md) / edpevent.se - [Gästrike Återvinnare](/doc/source/gastrikeatervinnare_se.md) / gastrikeatervinnare.se - [Jönköping - June Avfall & Miljö](/doc/source/juneavfall_se.md) / juneavfall.se - [Landskrona - Svalövs Renhållning](/doc/source/lsr_nu.md) / lsr.nu @@ -1214,9 +1216,12 @@ Waste collection schedules in the following formats and countries are supported. - [Region Gotland](/doc/source/gotland_se.md) / gotland.se - [Ronneby Miljöteknik](/doc/source/miljoteknik_se.md) / fyrfackronneby.se - [Samverkan Återvinning Miljö (SÅM)](/doc/source/samiljo_se.md) / samiljo.se +- [Skellefteå](/doc/source/edpevent_se.md) / skelleftea.se - [SRV Återvinning](/doc/source/srvatervinning_se.md) / srvatervinning.se - [SSAM](/doc/source/ssam_se.md) / ssam.se +- [SSAM Södra Smalånds Avfall & Miljö](/doc/source/edpevent_se.md) / ssam.se - [Sysav Sophämntning](/doc/source/sysav_se.md) / sysav.se +- [Uppsala Vatten](/doc/source/edpevent_se.md) / uppsalavatten.se - [Uppsala Vatten och Avfall AB](/doc/source/uppsalavatten_se.md) / uppsalavatten.se - [VA Syd Sophämntning](/doc/source/vasyd_se.md) / vasyd.se - [VIVAB Sophämtning](/doc/source/vivab_se.md) / vivab.se diff --git a/custom_components/waste_collection_schedule/sources.json b/custom_components/waste_collection_schedule/sources.json index 7651a1973..88a765960 100644 --- a/custom_components/waste_collection_schedule/sources.json +++ b/custom_components/waste_collection_schedule/sources.json @@ -6378,6 +6378,18 @@ "module": "affarsverken_se", "default_params": {} }, + { + "title": "Boden", + "module": "edpevent_se", + "default_params": { + "service_provider": "boden" + } + }, + { + "title": "EDPEvent - Multi Source", + "module": "edpevent_se", + "default_params": {} + }, { "title": "G\u00e4strike \u00c5tervinnare", "module": "gastrikeatervinnare_se", @@ -6433,6 +6445,13 @@ "module": "samiljo_se", "default_params": {} }, + { + "title": "Skellefte\u00e5", + "module": "edpevent_se", + "default_params": { + "service_provider": "skelleftea" + } + }, { "title": "SRV \u00c5tervinning", "module": "srvatervinning_se", @@ -6443,11 +6462,25 @@ "module": "ssam_se", "default_params": {} }, + { + "title": "SSAM S\u00f6dra Smal\u00e5nds Avfall & Milj\u00f6", + "module": "edpevent_se", + "default_params": { + "service_provider": "ssam" + } + }, { "title": "Sysav Soph\u00e4mntning", "module": "sysav_se", "default_params": {} }, + { + "title": "Uppsala Vatten", + "module": "edpevent_se", + "default_params": { + "service_provider": "uppsalavatten" + } + }, { "title": "Uppsala Vatten och Avfall AB", "module": "uppsalavatten_se", diff --git a/custom_components/waste_collection_schedule/translations/en.json b/custom_components/waste_collection_schedule/translations/en.json index e72dbe74c..665ac4c22 100644 --- a/custom_components/waste_collection_schedule/translations/en.json +++ b/custom_components/waste_collection_schedule/translations/en.json @@ -262,7 +262,8 @@ "postCode": "Post Code", "zipCode": "Zip Code", "garden_cutomer": "Garden Cutomer", - "app": "App" + "app": "App", + "service_provider": "Service Provider" }, "data_description": { "calendar_title": "A more readable, or user-friendly, name for the waste calendar. If nothing is provided, the name returned by the source will be used." @@ -508,7 +509,8 @@ "postCode": "Post Code", "zipCode": "Zip Code", "garden_cutomer": "Garden Cutomer", - "app": "App" + "app": "App", + "service_provider": "Service Provider" } } }, diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/edpevent_se.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/edpevent_se.py new file mode 100644 index 000000000..fe25ba24e --- /dev/null +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/edpevent_se.py @@ -0,0 +1,229 @@ +import json +import logging +from datetime import datetime + +import requests +from waste_collection_schedule import Collection # type: ignore[attr-defined] + +TITLE = "EDPEvent - Multi Source" +DESCRIPTION = "Source for all EDPEvent waste collection sources. This included multiple municipalities in Sweden." +URL = "https://www.edpevent.se" +TEST_CASES = { + "Boden - Bodens Kommun": { + "street_address": "KYRKGATAN 24", + "service_provider": "boden", + }, + "Boden - Gymnasiet": { + "street_address": "IDROTTSGATAN 4", + "url": "https://edpmobile.boden.se/FutureWeb/SimpleWastePickup", + }, + "Uppsalavatten - Test1": { + "street_address": "SADELVÄGEN 1", + "url": "https://futureweb.uppsalavatten.se/Uppsala/FutureWeb/SimpleWastePickup", + }, + "Uppsalavatten - Test2": { + "street_address": "BJÖRKLINGE-GRÄNBY 33", + "service_provider": "uppsalavatten", + }, + "Uppsalavatten - Test3": { + "street_address": "BJÖRKLINGE-GRÄNBY 20", + "service_provider": "uppsalavatten", + }, + "SSAM - Home": { + "street_address": "Asteroidvägen 1, Växjö", + "service_provider": "ssam", + }, + "SSAM - Slambrunn": { + "street_address": "Svanebro Ormesberga, Ör", + "service_provider": "ssam", + }, + "Skelleftea - Test1": { + "street_address": "Frögatan 76 -150", + "service_provider": "skelleftea", + }, +} + +COUNTRY = "se" +_LOGGER = logging.getLogger(__name__) + +# This maps the icon based on the waste type +ICON_MAP = { + "Brännbart": "mdi:trash-can", + "Matavfall tätt": "mdi:food", + "Deponi": "mdi:recycle", + "Restavfall": "mdi:trash-can", + "Matavfall": "mdi:food-apple", + "Slam": "", + "Trädgårdsavfall": "mdi:leaf", +} + +# This can be used to rename the waste types to something more user friendly +WASTE_TYPE_REPLACEMENTS = { + "FNI1": "Kärl 1", + "FNI2": "Kärl 2", +} + +MONTH_MAP = { + "Jan": 1, + "Feb": 2, + "Mar": 3, + "Apr": 4, + "Maj": 5, + "Jun": 6, + "Jul": 7, + "Aug": 8, + "Sep": 9, + "Okt": 10, + "Nov": 11, + "Dec": 12, +} + +SERVICE_PROVIDERS = { + "skelleftea": { + "title": "Skellefteå", + "url": "https://skelleftea.se", + "api_url": "https://wwwtk2.skelleftea.se/FutureWeb/SimpleWastePickup", + }, + "boden": { + "title": "Boden", + "url": "https://boden.se", + "api_url": "https://edpmobile.boden.se/FutureWeb/SimpleWastePickup", + }, + "ssam": { + "title": "SSAM Södra Smalånds Avfall & Miljö", + "url": "https://ssam.se", + "api_url": "https://edpfuture.ssam.se/FutureWeb/SimpleWastePickup", + }, + "uppsalavatten": { + "title": "Uppsala Vatten", + "url": "https://uppsalavatten.se", + "api_url": "https://futureweb.uppsalavatten.se/Uppsala/FutureWeb/SimpleWastePickup", + }, +} + +EXTRA_INFO = [ + { + "title": data["title"], + "url": data["url"], + "default_params": {"service_provider": provider}, + } + for provider, data in SERVICE_PROVIDERS.items() +] + + +class Source: + def __init__( + self, + street_address: str, + service_provider: str | None = None, + url: str | None = None, + ): + self._street_address = street_address + self._url = url + # Check if the user provided a url + if url is None: + # Raise an exception if the user did not provide a service provider (or url) + if service_provider is None: + raise ValueError("You must provide either a service provider or a url") + # Get the api url using the service provider + self._url = SERVICE_PROVIDERS.get(service_provider.lower(), {}).get( + "api_url" + ) + if self._url is None: + raise ValueError( + f"Unknown service provider: {service_provider}, use one of {[x for x in SERVICE_PROVIDERS.keys()]}" + ) + # Remove trailing slash from the url if present + if self._url.endswith("/"): + self._url = self._url[:-1] + + def fetch(self): + params = {"searchText": self._street_address} + # Use the street address to find the full street address with the building ID + searchUrl = self._url + "/SearchAdress" + # Search for the address + response = requests.post(searchUrl, params=params, timeout=30) + + address_data = json.loads(response.text) + address = None + # Make sure the response is valid and contains data + if address_data and len(address_data) > 0: + # Check if the request was successful + if address_data["Succeeded"]: + # The request can be successful but still not return any buildings at the specified address + if len(address_data["Buildings"]) > 0: + address = address_data["Buildings"][0] + else: + raise Exception( + f"No returned building address for: {self._street_address}" + ) + else: + raise Exception( + f"The server failed to fetch the building data for: {self._street_address}" + ) + + # Raise exception if all the above checks failed + if not address: + raise Exception( + f"Failed to find building address for: {self._street_address}" + ) + + # Use the address we got to get the waste collection schedule + params = {"address": address} + getUrl = self._url + "/GetWastePickupSchedule" + # Get the waste collection schedule + response = requests.get(getUrl, params=params, timeout=30) + + data = json.loads(response.text) + + entries = [] + for item in data["RhServices"]: + waste_type = "" + next_pickup = item["NextWastePickup"] + try: + if "v" in next_pickup: + date_parts = next_pickup.split() + month = MONTH_MAP[date_parts[1]] + date_joined = "-".join([date_parts[0], str(month), date_parts[2]]) + next_pickup_date = datetime.strptime( + date_joined, "v%W-%m-%Y" + ).date() + elif not next_pickup: + continue + else: + next_pickup_date = datetime.strptime(next_pickup, "%Y-%m-%d").date() + except ValueError: + # In some cases the date is just a month, so parse this as the + # first of the month to at least get something close + try: + next_pickup_date = datetime.strptime(next_pickup, "%b %Y").date() + except ValueError as month_parse_error: + _LOGGER.warning( + "Failed to parse date %s, %s,", + next_pickup, + str(month_parse_error), + ) + continue + + waste_type_prefix = item["WasteType"] + if item["WasteType"] in WASTE_TYPE_REPLACEMENTS: + waste_type_prefix = WASTE_TYPE_REPLACEMENTS[item["WasteType"]] + waste_type = ( + waste_type_prefix + + ", " + + item["BinType"]["ContainerType"] + + " " + + str(item["BinType"]["Size"]) + + item["BinType"]["Unit"] + ) + # Get the icon for the waste type, default to help icon if not found + icon = ICON_MAP.get(item["WasteType"], "mdi:help") + + found = found = any( + x.date == next_pickup_date and x.type == waste_type for x in entries + ) + if not found: + entries.append( + Collection(date=next_pickup_date, t=waste_type, icon=icon) + ) + return entries diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/ssam_se.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/ssam_se.py index affea20be..b307ada93 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/ssam_se.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/ssam_se.py @@ -1,12 +1,9 @@ -from datetime import datetime -import json import logging -import requests -from waste_collection_schedule import Collection # type: ignore[attr-defined] +from .edpevent_se import Source as EdpEventSource # type: ignore[attr-defined] -TITLE = "SSAM" -DESCRIPTION = "Source for SSAM waste collection." +TITLE = "SSAM (Deprecated)" +DESCRIPTION = "Deprecated, please use edpevent_se instead." URL = "https://ssam.se" TEST_CASES = { "Home": {"street_address": "Asteroidvägen 1, Växjö"}, @@ -16,94 +13,10 @@ _LOGGER = logging.getLogger(__name__) -class Source: +class Source(EdpEventSource): def __init__(self, street_address): - self._street_address = street_address - - def fetch(self): - params = {"searchText": self._street_address} - response = requests.post( - "https://edpfuture.ssam.se/FutureWeb/SimpleWastePickup/SearchAdress", - params=params, - timeout=30, + super().__init__(street_address, service_provider="ssam") + # Log a warning message indicating that this source is deprecated + _LOGGER.warning( + "The SSAM source is deprecated, please use edpevent_se instead." ) - - address_data = json.loads(response.text) - address = None - - if address_data and len(address_data) > 0: - address = address_data["Buildings"][0] - - if not address: - return [] - - params = {"address": address} - response = requests.get( - "https://edpfuture.ssam.se/FutureWeb/SimpleWastePickup/GetWastePickupSchedule", - params=params, - timeout=30, - ) - - data = json.loads(response.text) - - entries = [] - for item in data["RhServices"]: - waste_type = "" - next_pickup = item["NextWastePickup"] - try: - next_pickup_date = datetime.fromisoformat(next_pickup).date() - except ValueError as _: - # In some cases the date is just a month, so parse this as the - # first of the month to atleast get something close - try: - next_pickup_date = datetime.strptime(next_pickup, "%b %Y").date() - except ValueError as month_parse_error: - _LOGGER.warning( - "Failed to parse date %s, %s,", - next_pickup, - str(month_parse_error), - ) - continue - - if item["WasteType"] == "FNI1": - waste_type = ( - "Kärl 1, " - + item["BinType"]["ContainerType"] - + " " - + str(item["BinType"]["Size"]) - + item["BinType"]["Unit"] - ) - icon = "mdi:trash-can" - elif item["WasteType"] == "FNI2": - waste_type = ( - "Kärl 2, " - + item["BinType"]["ContainerType"] - + " " - + str(item["BinType"]["Size"]) - + item["BinType"]["Unit"] - ) - icon = "mdi:trash-can" - elif item["BinType"]["Code"] == "KM140": - waste_type = "Matpåsar" - icon = "mdi:recycle" - else: - waste_type = ( - item["WasteType"] - + " " - + item["BinType"]["ContainerType"] - + " " - + str(item["BinType"]["Size"]) - + item["BinType"]["Unit"] - ) - icon = "mdi:trash-can" - if item["WasteType"] == "Trädgårdsavfall": - icon = "mdi:leaf" - found = 0 - for x in entries: - if x.date == next_pickup_date and x.type == waste_type: - found = 1 - if found == 0: - entries.append( - Collection(date=next_pickup_date, t=waste_type, icon=icon) - ) - return entries diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/uppsalavatten_se.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/uppsalavatten_se.py index 549ccdfa9..47c51958c 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/uppsalavatten_se.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/uppsalavatten_se.py @@ -1,14 +1,15 @@ -import json -import urllib.parse -from datetime import datetime +import logging -import requests -from waste_collection_schedule import Collection +# from waste_collection_schedule import Collection +from .edpevent_se import Source as EdpEventSource -TITLE = "Uppsala Vatten och Avfall AB" -DESCRIPTION = "Source script for uppsalavatten.se" +TITLE = "Uppsala Vatten och Avfall AB (Deprecated)" +DESCRIPTION = "Deprecated, please use edpevent_se instead." URL = "https://www.uppsalavatten.se" +# Init logger +_LOGGER = logging.getLogger(__name__) + TEST_CASES = { "Test1": { "city": "BJÖRKLINGE", @@ -24,75 +25,11 @@ }, } -API_URLS = { - "address_search": "https://futureweb.uppsalavatten.se/Uppsala/FutureWebBasic/SimpleWastePickup/SearchAdress", - "collection": "https://futureweb.uppsalavatten.se/Uppsala/FutureWebBasic/SimpleWastePickup/GetWastePickupSchedule", -} - - -ICON_MAP = { - "Restavfall": "mdi:trash-can", - "Matavfall": "mdi:food-apple", - "Slam": "", -} - -MONTH_MAP = { - "Jan": 1, - "Feb": 2, - "Mar": 3, - "Apr": 4, - "Maj": 5, - "Jun": 6, - "Jul": 7, - "Aug": 8, - "Sep": 9, - "Okt": 10, - "Nov": 11, - "Dec": 12, -} - -class Source: +class Source(EdpEventSource): def __init__(self, street, city): - self.street = street - self.city = city - # self.facid = facid - - def fetch(self): - # request to get facility id - addresslist = requests.post( - API_URLS["address_search"], - {"searchText": f"{self.street.upper()}, {self.city.upper()}"}, + super().__init__(street, service_provider="uppsalavatten") + # Log a warning message indicating that this source is deprecated + _LOGGER.warning( + "The Uppsala Vatten och Avfall AB source is deprecated, please use edpevent_se instead" ) - addresslist.raise_for_status() - adresslist_json = json.loads(addresslist.text) - - payload = {"address": adresslist_json["Buildings"][0]} - - payload_str = urllib.parse.urlencode(payload, encoding="utf8") - # request for the wasteschedule - wasteschedule = requests.get(API_URLS["collection"], params=payload_str) - wasteschedule.raise_for_status() - - data = json.loads(wasteschedule.text) - entries = [] - for i in data["RhServices"]: - icon = ICON_MAP.get(i["WasteType"]) - if "v" in i["NextWastePickup"]: - date_parts = i["NextWastePickup"].split() - month = MONTH_MAP[date_parts[1]] - date_joined = "-".join([date_parts[0], str(month), date_parts[2]]) - date = datetime.strptime(date_joined, "v%W-%m-%Y").date() - elif not i["NextWastePickup"]: - continue - else: - date = datetime.strptime(i["NextWastePickup"], "%Y-%m-%d").date() - - entries.append( - Collection( - t=i["WasteType"], - icon=icon, - date=date, - ) - ) - return entries diff --git a/doc/source/edpevent_se.md b/doc/source/edpevent_se.md new file mode 100644 index 000000000..976fe6f24 --- /dev/null +++ b/doc/source/edpevent_se.md @@ -0,0 +1,94 @@ +# EDPEvent + +This is a waste collection schedule integration for the EDPEvent API. EDPEent is used in multiple municipalities in Sweden. The previous SSAM and Uppsala Vatten integrations have been merged into this integration. +This integration now also supports the municipalities of Boden and Skellefteå. + +## Current supported service providers + +- `boden`: Boden +- `skelleftea`: Skellefteå +- `ssam`: SSAM Södra Smalånds Avfall & Miljö +- `uppsalavatten`: Uppsala Vatten + + +## Configuration via configuration.yaml + +```yaml +waste_collection_schedule: + sources: + - name: edpevent_se + args: + street_address: STREET_ADDRESS + service_provider: SERVICE_PROVIDER + url: URL +``` + +### Configuration Variables + +**street_address** +*(string) (required)* + +**service_provider** +*(string) (optional)* + +***url*** +*(string) (optional)* + +### Note on optional parameters + +While service_provider and url are optional. At least one of them must be provided. The service provider can be used with the preconfigured cities. The url can be used to configure the integration with a custom city. + +## Examples + +Support for Boden's municipality waste collection schedule. + +```yaml +waste_collection_schedule: + sources: + - name: edpevent_se + args: + street_address: KYRKGATAN 24 + service_provider: boden +``` + +Support for schedules provided by Uppsala Vatten och Avfall AB, serving the municipality of Uppsala. + +```yaml +waste_collection_schedule: + sources: + - name: edpevent_se + args: + street_address: SADELVÄGEN 1 + service_provider: uppsalavatten +``` + +Support for schedules provided by [SSAM](https://ssam.se/mitt-ssam/hamtdagar.html), serving the municipality of Lessebo, Tingsryd, Älmhult, Markaryd and Växjö Sweden. + +```yaml +waste_collection_schedule: + sources: + - name: edpevent_se + args: + street_address: Asteroidvägen 1, Växjö + service_provider: ssam +``` + +Support for schedules provided by Skellefteå municipality. + +```yaml +waste_collection_schedule: + sources: + - name: edpevent_se + args: + street_address: Frögatan 76 -150 + service_provider: skelleftea +``` + +## How to get the correct address + +To find your correct address, search for it on your service providers website: + +- [Boden](https://www.boden.se/boende-trafik/avfall-och-aterbruk/avfall-395A) +- [Skellefteå](https://skelleftea.se/invanare/startsida/bygga-bo-och-miljo/avfall-och-atervinning/sophamtning---nar-toms-soporna) +- [SSAM](https://ssam.se/mitt-ssam/hamtdagar.html) +- [Uppsala Vatten](https://www.uppsalavatten.se/sjalvservice/hamtningar-och-berakningar/dag-for-sophamtning-och-slamtomning) diff --git a/doc/source/ssam_se.md b/doc/source/ssam_se.md index 42f667e7f..69a8cac20 100644 --- a/doc/source/ssam_se.md +++ b/doc/source/ssam_se.md @@ -1,4 +1,6 @@ -# SSAM +# SSAM (Deprecated) + +This integration is deprecated and will probably not work forever. Please use the [edpevent_se source](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/edpevent_se.md) instead. Support for schedules provided by [SSAM](https://ssam.se/mitt-ssam/hamtdagar.html), serving the municipality of Lessebo, Tingsryd, Älmhult, Markaryd and Växjö Sweden. diff --git a/doc/source/uppsalavatten_se.md b/doc/source/uppsalavatten_se.md index 8863cc6b9..3b71a8b17 100644 --- a/doc/source/uppsalavatten_se.md +++ b/doc/source/uppsalavatten_se.md @@ -1,4 +1,6 @@ -# Uppsala Vatten och Avfall AB +# Uppsala Vatten och Avfall AB (Deprecated) + +This integration is deprecated and will probably not work forever. Please use the [edpevent_se source](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/edpevent_se.md) instead. Support for schedules provided by [Uppsala Vatten och Avfall AB](https://www.uppsalavatten.se), serving the municipality of Uppsala. diff --git a/info.md b/info.md index e2f4887e5..a83d327b3 100644 --- a/info.md +++ b/info.md @@ -34,7 +34,7 @@ Waste collection schedules from service provider web sites are updated daily, de | Norway | BIR (Bergensområdets Interkommunale Renovasjonsselskap), IRiS, Min Renovasjon, Movar IKS, Oslo Kommune, ReMidt Orkland muni, Sandnes Kommune, Stavanger Kommune, Trondheim | | Poland | Bydgoszcz Pronatura, Ecoharmonogram, Gmina Miękinia, Koziegłowy/Objezierze/Oborniki, Poznań, Warsaw, Wrocław | | Slovenia | Moji odpadki, Ljubljana | -| Sweden | Affärsverken, Gästrike Återvinnare, Jönköping - June Avfall & Miljö, Landskrona - Svalövs Renhållning, Lerum Vatten och Avlopp, Linköping - Tekniska Verken, Lund Waste Collection, Norrtalje Vatten & Avfall, North / Middle Bohuslän - Rambo AB, Region Gotland, Ronneby Miljöteknik, Samverkan Återvinning Miljö (SÅM), SRV Återvinning, SSAM, Sysav Sophämntning, Uppsala Vatten och Avfall AB, VA Syd Sophämntning, VIVAB Sophämtning | +| Sweden | Affärsverken, Boden, EDPEvent - Multi Source, Gästrike Återvinnare, Jönköping - June Avfall & Miljö, Landskrona - Svalövs Renhållning, Lerum Vatten och Avlopp, Linköping - Tekniska Verken, Lund Waste Collection, Norrtalje Vatten & Avfall, North / Middle Bohuslän - Rambo AB, Region Gotland, Ronneby Miljöteknik, Samverkan Återvinning Miljö (SÅM), Skellefteå, SRV Återvinning, SSAM, SSAM Södra Smalånds Avfall & Miljö, Sysav Sophämntning, Uppsala Vatten, Uppsala Vatten och Avfall AB, VA Syd Sophämntning, VIVAB Sophämtning | | Switzerland | A-Region, Alchenstorf, Andwil, Appenzell, Berg, Bühler, Canton of Zürich, Eggersriet, Gais, Gaiserwald, Goldach, Grosswangen, Grub, Heiden, Herisau, Horn, Hundwil, Häggenschwil, Lindau, Lutzenberg, Muolen, Mörschwil, Münchenstein, Münsingen BE, Switzerland, Real Luzern, Rehetobel, Rorschach, Rorschacherberg, Schwellbrunn, Schönengrund, Speicher, Stein, Steinach, Teufen, Thal, Trogen, Tübach, Untereggen, Urnäsch, Wald, Waldkirch, Waldstatt, Wittenbach, Wolfhalden | | United Kingdom | Aberdeenshire Council, Adur & Worthing Councils, Allerdale Borough Council, Amber Valley Borough Council, Anglesey, Ards and North Down Borough Council, Ashfield District Council, Ashford Borough Council, Aylesbury Vale District Council, Barnsley Metropolitan Borough Council, Basildon Council, Basingstoke and Deane Borough Council, Bath & North East Somerset Council, BCP Council, Bedford Borough Council, Binzone, Birmingham City Council, Blackburn with Darwen Borough Council, Blackpool Council, Borough Council of King's Lynn & West Norfolk, Borough of Broxbourne Council, Bracknell Forest Council, Bradford Metropolitan District Council, Braintree District Council, Breckland Council, Bristol City Council, Broadland District Council, Bromsgrove City Council, Broxtowe Borough Council, Buckinghamshire Waste Collection - Former Chiltern, South Bucks or Wycombe areas, Burnley Council, Bury Council, Cambridge City Council, Canterbury City Council, Cardiff Council, Central Bedfordshire Council, Cherwell District Council, Cheshire East Council, Cheshire West and Chester Council, Chesterfield Borough Council, Chichester District Council, City of Doncaster Council, City Of Lincoln Council, City of York Council, Colchester City Council, Conwy County Borough Council, Cornwall Council, Crawley Borough Council (myCrawley), Croydon Council, Darlington Borough Council, Denbighshire County Council, Derby City Council, Dudley Metropolitan Borough Council, Durham County Council, East Ayrshire Council, East Cambridgeshire District Council, East Devon District Council, East Herts Council, East Lothian, East Northamptonshire and Wellingborough, East Renfrewshire Council, East Riding of Yorkshire Council, Eastbourne Borough Council, Eastleigh Borough Council, Elmbridge Borough Council, Environment First, Exeter City Council, Falkirk, Fareham Borough Council, FCC Environment, Fenland District Council, Fife Council, Flintshire, Fylde Council, Gateshead Council, Gedling Borough Council (unofficial), Glasgow City Council, Guildford Borough Council, Gwynedd, Harborough District Council, Haringey Council, Harlow Council, Hart District Council, Herefordshire City Council, Highland, Horsham District Council, Hull City Council, Huntingdonshire District Council, iTouchVision, Joint Waste Solutions, Kirklees Council, Lancaster City Council, Leicester City Council, Lewes District Council, Lichfield District Council, Lisburn and Castlereagh City Council, Liverpool City Council, London Borough of Barking and Dagenham, London Borough of Bexley, London Borough of Bromley, London Borough of Camden, London Borough of Harrow, London Borough of Hounslow, London Borough of Lewisham, London Borough of Merton, London Borough of Newham, Maidstone Borough Council, Maldon District Council, Manchester City Council, Mansfield District Council, Mendip District Council, Mid-Sussex District Council, Middlesbrough Council, Milton Keynes council, Moray Council, Newark & Sherwood District Council, Newcastle City Council, Newcastle Under Lyme Borough Council, Newport City Council, North Ayrshire Council, North Herts Council, North Kesteven District Council, North Lincolnshire Council, North Northamptonshire council, North Somerset Council, North West Leicestershire District Council, North Yorkshire Council - Hambleton, North Yorkshire Council - Harrogate, North Yorkshire Council - Scarborough, North Yorkshire Council - Selby, Nottingham City Council, Oxford City Council, Peterborough City Council, Portsmouth City Council, Reading Council, Redbridge Council, Reigate & Banstead Borough Council, Renfrewshire Council, Rhondda Cynon Taf County Borough Council, Richmondshire District Council, Rotherham Metropolitan Borough Council, Runnymede Borough Council, Rushcliffe Brough Council, Rushmoor Borough Council, Salford City Council, Sedgemoor District Council, Sheffield City Council, Shropshire Council, Solihull Council, Somerset Council, Somerset County Council, Somerset West & Taunton District Council, South Cambridgeshire District Council, South Derbyshire District Council, South Gloucestershire Council, South Hams District Council, South Holland District Council, South Kesteven District Council, South Norfolk Council, South Oxfordshire District Council, South Somerset District Council, South Tyneside Council, Southampton City Council, Stafford Borough Council, Stevenage Borough Council, Stirling.gov.uk, Stockport Council, Stockton-on-Tees Borough Council, Stoke-on-Trent, Stratford District Council, Stroud District Council, Surrey Heath Borough Council, Sutton Council, London, Swansea Council, Swindon Borough Council, Tameside Metropolitan Borough Council, Telford and Wrekin Council, Test Valley Borough Council, Tewkesbury Borough Council, The Royal Borough of Kingston Council, Tonbridge and Malling Borough Council, Tunbridge Wells, UK Bin Collection Schedule (UKBCD) project, Uttlesford District Council, Vale of Glamorgan Council, Vale of White Horse District Council, Walsall Council, Warrington Borough Council, Warwick District Council, Waverley Borough Council, Wealden District Council, Welwyn Hatfield Borough Council, West Berkshire Council, West Devon Borough Council, West Dunbartonshire Council, West Northamptonshire council, West Suffolk Council, Westmorland & Furness Council, Barrow area, Westmorland & Furness Council, South Lakeland area, Wigan Council, Wiltshire Council, Windsor and Maidenhead, Wirral Council, Woking Borough Council, Wokingham Borough Council, Wychavon District Council, Wyre Forest District Council | | United States of America | Albuquerque, New Mexico, USA, City of Austin, TX, City of Bloomington, City of Cambridge, City of Gastonia, NC, City of Georgetown, TX, City of Oklahoma City, City of Pittsburgh, Louisville, Kentucky, USA, Newark, Delaware, USA, Olympia, Washington, USA, ReCollect, Recycle Coach, Republic Services, Seattle Public Utilities, Tucson, Arizona, USA | diff --git a/update_docu_links.py b/update_docu_links.py index de68f3b6f..d027bd632 100755 --- a/update_docu_links.py +++ b/update_docu_links.py @@ -123,6 +123,18 @@ def split_camel_and_snake_case(s): s = re.sub("([a-z0-9])([A-Z])", r"\1 \2", s) # Split CamelCase return s.replace("_", " ").split() # Split snake_case +def update_edpevent_se(modules: dict[str, ModuleType]): + module = modules.get("edpevent_se") + if not module: + print("edpevent_se not found") + return + services = getattr(module, "SERVICE_PROVIDERS", {}) + + str = "" + for provider, data in sorted(services.items()): + str += f'- `{provider}`: {data["title"]}\n' + + _patch_file("doc/source/edpevent_se.md", "service", str) def main() -> None: sources: list[SourceInfo] = [] @@ -228,7 +240,8 @@ def browse_sources() -> list[SourceInfo]: update_citiesapps_com(modules) update_app_abfallplus_de(modules) update_abfallnavi_de(modules) - + update_edpevent_se(modules) + return sources