mirror of
https://github.com/sascha-hemi/hacs_waste_collection_schedule.git
synced 2026-03-21 04:06:03 +01:00
prepare for automatic docu generation
- check source titles - check source urls - add extra info for sources which serve multiple districts/municipalities
This commit is contained in:
@@ -7,11 +7,12 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "AbfallPlus"
|
||||
TITLE = "Abfall.IO / AbfallPlus"
|
||||
DESCRIPTION = (
|
||||
"Source for AbfallPlus.de waste collection. Service is hosted on abfall.io."
|
||||
)
|
||||
URL = "https://www.abfallplus.de"
|
||||
COUNTRY = "de"
|
||||
TEST_CASES = {
|
||||
"Waldenbuch": {
|
||||
"key": "8215c62763967916979e0e8566b6172e",
|
||||
|
||||
@@ -3,11 +3,11 @@ import requests
|
||||
from waste_collection_schedule import Collection
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "Abfall Neunkirchen Siegerland"
|
||||
TITLE = "Neunkirchen Siegerland"
|
||||
DESCRIPTION = " Source for 'Abfallkalender Neunkirchen Siegerland'."
|
||||
URL = "https://www.neunkirchen-siegerland.de"
|
||||
TEST_CASES = {
|
||||
"Waldstraße":{ "street":"Waldstr"}
|
||||
"Waldstraße":{ "strasse":"Waldstr"}
|
||||
}
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -4,7 +4,7 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "Abfall Zollernalbkreis"
|
||||
TITLE = "Abfallwirtschaft Zollernalbkreis"
|
||||
DESCRIPTION = "Source for Abfallwirtschaft Zollernalbkreis waste collection."
|
||||
URL = "https://www.abfallkalender-zak.de"
|
||||
TEST_CASES = {
|
||||
@@ -42,6 +42,16 @@ TEST_CASES = {
|
||||
},
|
||||
}
|
||||
|
||||
ICON_MAP = {
|
||||
"Restmüll": "mdi:trash-can",
|
||||
"Grünabfall" : "mdi:leaf",
|
||||
"Gelber Sack" : "mdi:sack",
|
||||
"Papiertonne" : "mdi:package-variant",
|
||||
"Bildschirm-/Kühlgeräte" : "mdi:television-classic",
|
||||
"Schadstoffsammlung" : "mdi:biohazard",
|
||||
"altmetalle" : "mdi:nail",
|
||||
}
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(self, city, types, street=None):
|
||||
@@ -49,15 +59,6 @@ class Source:
|
||||
self._street = street
|
||||
self._types = types
|
||||
self._ics = ICS()
|
||||
self._iconMap = {
|
||||
"Restmüll": "mdi:trash-can",
|
||||
"Grünabfall" : "mdi:leaf",
|
||||
"Gelber Sack" : "mdi:sack",
|
||||
"Papiertonne" : "mdi:package-variant",
|
||||
"Bildschirm-/Kühlgeräte" : "mdi:television-classic",
|
||||
"Schadstoffsammlung" : "mdi:biohazard",
|
||||
"altmetalle" : "mdi:nail",
|
||||
}
|
||||
|
||||
def fetch(self):
|
||||
now = datetime.now()
|
||||
@@ -95,6 +96,6 @@ class Source:
|
||||
waste_type = d[1]
|
||||
next_pickup_date = d[0]
|
||||
|
||||
entries.append(Collection(date=next_pickup_date, t=waste_type, icon=self._iconMap.get(waste_type,"mdi:trash-can")))
|
||||
entries.append(Collection(date=next_pickup_date, t=waste_type, icon=ICON_MAP.get(waste_type,"mdi:trash-can")))
|
||||
|
||||
return entries
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.AbfallnaviDe import AbfallnaviDe
|
||||
|
||||
TITLE = "AbfallNavi"
|
||||
TITLE = "AbfallNavi (RegioIT.de)"
|
||||
DESCRIPTION = (
|
||||
"Source for AbfallNavi waste collection. AbfallNavi is a brand name of regioit.de."
|
||||
)
|
||||
|
||||
@@ -4,7 +4,7 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "Landkreis Forchheim"
|
||||
TITLE = "Abfalltermine Forchheim"
|
||||
DESCRIPTION = "Source for Landkreis Forchheim"
|
||||
URL = "https://www.abfalltermine-forchheim.de/"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -5,9 +5,9 @@ import pytz
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "ALW Wolfenbüttel"
|
||||
TITLE = "Abfallwirtschaft Landkreis Wolfenbüttel"
|
||||
DESCRIPTION = "Source for ALW Wolfenbüttel."
|
||||
URL = "https://abfallapp.alw-wf.de"
|
||||
URL = "https://alw-wf.de"
|
||||
TEST_CASES = {
|
||||
"Linden alte Straße": {"ort": "Linden mit Okertalsiedlung", "strasse": "Siedlung"},
|
||||
"Linden neuere Straße": {
|
||||
@@ -17,6 +17,7 @@ TEST_CASES = {
|
||||
"Dettum": {"ort": "Dettum", "strasse": "Egal!"},
|
||||
}
|
||||
|
||||
API_URL = "https://abfallapp.alw-wf.de"
|
||||
AUTH_DATA = {
|
||||
"auth": {
|
||||
"Name": "ALW",
|
||||
@@ -41,7 +42,7 @@ class Source:
|
||||
auth_params = json.dumps(AUTH_DATA)
|
||||
|
||||
# ALW WF uses a self-signed certificate so we need to disable certificate verification
|
||||
r = requests.post(f"{URL}/GetOrte.php", data=auth_params, verify=False)
|
||||
r = requests.post(f"{API_URL}/GetOrte.php", data=auth_params, verify=False)
|
||||
orte = r.json()
|
||||
if orte["result"][0]["StatusCode"] != 200:
|
||||
raise Exception(f"Error getting Orte: {orte['result'][0]['StatusMsg']}")
|
||||
@@ -53,7 +54,7 @@ class Source:
|
||||
if ort_id is None:
|
||||
raise Exception(f"Error finding Ort {self._ort}")
|
||||
|
||||
r = requests.post(f"{URL}/GetStrassen.php", data=auth_params, verify=False)
|
||||
r = requests.post(f"{API_URL}/GetStrassen.php", data=auth_params, verify=False)
|
||||
strassen = r.json()
|
||||
if strassen["result"][0]["StatusCode"] != 200:
|
||||
raise Exception(
|
||||
@@ -73,7 +74,7 @@ class Source:
|
||||
if strasse_id is None:
|
||||
raise Exception(f"Error finding Straße {self._strasse}")
|
||||
|
||||
r = requests.post(f"{URL}/GetArten.php", data=auth_params, verify=False)
|
||||
r = requests.post(f"{API_URL}/GetArten.php", data=auth_params, verify=False)
|
||||
arten = r.json()
|
||||
if arten["result"][0]["StatusCode"] != 200:
|
||||
raise Exception(f"Error getting Arten: {arten['result'][0]['StatusMsg']}")
|
||||
@@ -84,7 +85,7 @@ class Source:
|
||||
|
||||
entries = []
|
||||
r = requests.post(
|
||||
f"{URL}/GetTermine.php/{strasse_id}", data=auth_params, verify=False
|
||||
f"{API_URL}/GetTermine.php/{strasse_id}", data=auth_params, verify=False
|
||||
)
|
||||
termine = r.json()
|
||||
if termine["result"][0]["StatusCode"] != 200:
|
||||
|
||||
@@ -7,7 +7,7 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "Abfall ART Trier"
|
||||
TITLE = "ART Trier"
|
||||
DESCRIPTION = "Source for waste collection of ART Trier."
|
||||
URL = "https://www.art-trier.de"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -7,7 +7,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
# Include work around for SSL UNSAFE_LEGACY_RENEGOTIATION_DISABLED error
|
||||
from waste_collection_schedule.service.SSLError import get_legacy_session
|
||||
|
||||
TITLE = "Auckland council"
|
||||
TITLE = "Auckland Council"
|
||||
DESCRIPTION = "Source for Auckland council."
|
||||
URL = "https://aucklandcouncil.govt.nz"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -3,9 +3,9 @@ from bs4 import BeautifulSoup
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "AW Harburg"
|
||||
TITLE = "Abfallwirtschaft Landkreis Harburg"
|
||||
DESCRIPTION = "Abfallwirtschaft Landkreis Harburg"
|
||||
URL = "https://www.landkreis-harburg.de/bauen-umwelt/abfallwirtschaft/abfallkalender/"
|
||||
URL = "https://www.landkreis-harburg.de"
|
||||
|
||||
TEST_CASES = {
|
||||
"CityWithTwoLevels": {"level_1": "Hanstedt", "level_2": "Evendorf"},
|
||||
@@ -16,6 +16,7 @@ TEST_CASES = {
|
||||
},
|
||||
}
|
||||
|
||||
API_URL = "https://www.landkreis-harburg.de/bauen-umwelt/abfallwirtschaft/abfallkalender/"
|
||||
HEADERS = {
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64)",
|
||||
}
|
||||
@@ -33,11 +34,11 @@ class Source:
|
||||
# Get the IDs of the districts on the first level
|
||||
# Double loading is on purpose because sometimes the webpage has an overlay
|
||||
# which is gone on the second try in a session
|
||||
r = session.get(URL, headers=HEADERS)
|
||||
r = session.get(API_URL, headers=HEADERS)
|
||||
if "Zur aufgerufenen Seite" in r.text:
|
||||
r = session.get(URL, headers=HEADERS)
|
||||
r = session.get(API_URL, headers=HEADERS)
|
||||
if r.status_code != 200:
|
||||
raise Exception(f"Error: failed to fetch first url: {URL}")
|
||||
raise Exception(f"Error: failed to fetch first url: {API_URL}")
|
||||
|
||||
# Get the IDs of the districts on the first level
|
||||
id = self.parse_level(r.text, 1)
|
||||
|
||||
@@ -6,11 +6,13 @@ from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "AWB Oldenburg"
|
||||
DESCRIPTION = "Source for 'Abfallwirtschaftsbetrieb Stadt Oldenburg (Oldb)'."
|
||||
URL = "https://services.oldenburg.de/index.php"
|
||||
URL = "https://oldenburg.de"
|
||||
TEST_CASES = {
|
||||
"Polizeiinspektion Oldenburg": {"street": "Friedhofsweg", "house_number": 30}
|
||||
}
|
||||
|
||||
API_URL = "https://services.oldenburg.de/index.php"
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(self, street, house_number):
|
||||
@@ -39,7 +41,7 @@ class Source:
|
||||
args = urllib.parse.urlencode(args, quote_via=urllib.parse.quote)
|
||||
|
||||
# post request
|
||||
r = requests.get(URL, params=args)
|
||||
r = requests.get(API_URL, params=args)
|
||||
|
||||
dates = self._ics.convert(r.text)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import logging
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "AWIDO"
|
||||
TITLE = "AWIDO Online"
|
||||
DESCRIPTION = "Source for AWIDO waste collection."
|
||||
URL = "https://www.awido-online.de/"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -5,7 +5,7 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "AWN"
|
||||
TITLE = "Abfallwirtschaft Neckar-Odenwald-Kreis"
|
||||
DESCRIPTION = "Source for AWN (Abfallwirtschaft Neckar-Odenwald-Kreis)."
|
||||
URL = "https://www.awn-online.de"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -5,7 +5,7 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "AWR"
|
||||
TITLE = "Abfallwirtschaft Rendsburg"
|
||||
DESCRIPTION = "Source for Abfallwirtschaft Rendsburg"
|
||||
URL = "https://www.awr.de"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -5,7 +5,7 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "AWSH"
|
||||
TITLE = "Abfallwirtschaft Südholstein"
|
||||
DESCRIPTION = "Source for Abfallwirtschaft Südholstein"
|
||||
URL = "https://www.awsh.de"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -10,7 +10,7 @@ from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = 'Banyule City Council'
|
||||
DESCRIPTION = 'Source for Banyule City Council rubbish collection.'
|
||||
URL = 'https://www.banyule.vic.gov.au/binday'
|
||||
URL = 'https://www.banyule.vic.gov.au'
|
||||
TEST_CASES = {
|
||||
'Monday A': {'street_address': '6 Mandall Avenue, IVANHOE'},
|
||||
'Monday A Geolocation ID': {'geolocation_id': '4f7ebfca-1526-4363-8b87-df3103a10a87'},
|
||||
|
||||
@@ -5,7 +5,7 @@ from html.parser import HTMLParser
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Berline Recycling"
|
||||
TITLE = "Berlin Recycling"
|
||||
DESCRIPTION = "Source for Berlin Recycling waste collection."
|
||||
URL = "https://berlin-recycling.de"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -5,7 +5,7 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "BMV.at"
|
||||
TITLE = "Burgenländischer Müllverband"
|
||||
DESCRIPTION = "Source for BMV, Austria"
|
||||
URL = "https://www.bmv.at"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -4,7 +4,7 @@ import requests
|
||||
from dateutil import parser
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "bracknell-forest.gov.uk"
|
||||
TITLE = "Bracknell Forest Council"
|
||||
DESCRIPTION = "Bracknell Forest Council, UK - Waste Collection"
|
||||
URL = "https://selfservice.mybfc.bracknell-forest.gov.uk"
|
||||
TEST_CASES = {
|
||||
@@ -13,7 +13,8 @@ TEST_CASES = {
|
||||
"32 Ashbourne": {"house_number": "32", "post_code": "RG12 8SG"},
|
||||
"1 Acacia Avenue": {"house_number": "1", "post_code": "GU47 0RU"},
|
||||
}
|
||||
ICONS = {
|
||||
|
||||
ICON_MAP = {
|
||||
"General Waste": "mdi:trash-can",
|
||||
"Recycling": "mdi:recycle",
|
||||
"Garden": "mdi:leaf",
|
||||
@@ -68,7 +69,7 @@ class Source:
|
||||
collection_lookup.raise_for_status()
|
||||
collections = collection_lookup.json()["response"]["collections"]
|
||||
entries = []
|
||||
for waste_type in ICONS.keys():
|
||||
for waste_type in ICON_MAP.keys():
|
||||
try:
|
||||
entries.append(
|
||||
Collection(
|
||||
@@ -78,7 +79,7 @@ class Source:
|
||||
]["date"]
|
||||
).date(),
|
||||
t=waste_type,
|
||||
icon=ICONS[waste_type],
|
||||
icon=ICON_MAP[waste_type],
|
||||
)
|
||||
)
|
||||
except (StopIteration, TypeError):
|
||||
|
||||
@@ -11,18 +11,19 @@ import http.client as http_client
|
||||
import ssl
|
||||
import urllib3
|
||||
|
||||
TITLE = "Bradford.gov.uk"
|
||||
TITLE = "Bradford Metropolitan District Council"
|
||||
DESCRIPTION = (
|
||||
"Source for Bradford.gov.uk services for Bradford Metropolitan Council, UK."
|
||||
)
|
||||
URL = "https://onlineforms.bradford.gov.uk/ufs/"
|
||||
URL = "https://bradford.gov.uk"
|
||||
TEST_CASES = {
|
||||
"Ilkley": {"uprn": "100051250665"},
|
||||
"Bradford": {"uprn": "100051239296"},
|
||||
"Baildon": {"uprn": "10002329242"},
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
API_URL = "https://onlineforms.bradford.gov.uk/ufs/"
|
||||
ICON_MAP = {
|
||||
"REFUSE": "mdi:trash-can",
|
||||
"RECYCLING": "mdi:recycle",
|
||||
"GARDEN": "mdi:leaf",
|
||||
@@ -30,16 +31,16 @@ ICONS = {
|
||||
|
||||
from pprint import pprint
|
||||
|
||||
class CustomHttpAdapter (requests.adapters.HTTPAdapter):
|
||||
'''Transport adapter" that allows us to use custom ssl_context.'''
|
||||
|
||||
def __init__(self, ssl_context=None, **kwargs):
|
||||
self.ssl_context = ssl_context
|
||||
super().__init__(**kwargs)
|
||||
|
||||
def init_poolmanager(self, connections, maxsize, block=False):
|
||||
self.poolmanager = urllib3.poolmanager.PoolManager(
|
||||
num_pools=connections, maxsize=maxsize,
|
||||
class CustomHttpAdapter (requests.adapters.HTTPAdapter):
|
||||
'''Transport adapter" that allows us to use custom ssl_context.'''
|
||||
|
||||
def __init__(self, ssl_context=None, **kwargs):
|
||||
self.ssl_context = ssl_context
|
||||
super().__init__(**kwargs)
|
||||
|
||||
def init_poolmanager(self, connections, maxsize, block=False):
|
||||
self.poolmanager = urllib3.poolmanager.PoolManager(
|
||||
num_pools=connections, maxsize=maxsize,
|
||||
block=block, ssl_context=self.ssl_context)
|
||||
|
||||
class Source:
|
||||
@@ -59,7 +60,7 @@ class Source:
|
||||
s.cookies.set(
|
||||
"COLLECTIONDATES", self._uprn, domain="onlineforms.bradford.gov.uk"
|
||||
)
|
||||
r = s.get(f"{URL}/collectiondates.eb")
|
||||
r = s.get(f"{API_URL}/collectiondates.eb")
|
||||
|
||||
soup = BeautifulSoup(r.text, features="html.parser")
|
||||
div = soup.find_all("table", {"role": "region"})
|
||||
@@ -87,7 +88,7 @@ class Source:
|
||||
entry.text.strip(), "%a %b %d %Y"
|
||||
).date(),
|
||||
t=type,
|
||||
icon=ICONS[type],
|
||||
icon=ICON_MAP[type],
|
||||
)
|
||||
)
|
||||
except ValueError:
|
||||
|
||||
@@ -3,7 +3,7 @@ from bs4 import BeautifulSoup
|
||||
from dateutil import parser
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "braintree.gov.uk"
|
||||
TITLE = "Braintree District Council"
|
||||
DESCRIPTION = "Braintree District Council, UK - Waste Collection"
|
||||
URL = "https://www.braintree.gov.uk"
|
||||
TEST_CASES = {
|
||||
@@ -13,7 +13,7 @@ TEST_CASES = {
|
||||
"20 Peel Crescent": {"house_number": "20", "post_code": "CM7 2RS"},
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"Grey Bin": "mdi:trash-can",
|
||||
"Clear Sack": "mdi:recycle",
|
||||
"Green Bin": "mdi:leaf",
|
||||
@@ -51,7 +51,7 @@ class Source:
|
||||
Collection(
|
||||
date=parser.parse(collection_date).date(),
|
||||
t=collection_type,
|
||||
icon=ICONS[collection_type]
|
||||
icon=ICON_MAP[collection_type]
|
||||
)
|
||||
)
|
||||
except (StopIteration, TypeError):
|
||||
|
||||
@@ -6,7 +6,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Brisbane City Council"
|
||||
DESCRIPTION = "Source for Brisbane City Council rubbish collection."
|
||||
URL = "https://www.brisbane.qld.gov.au/clean-and-green/rubbish-tips-and-bins/rubbish-collections/bin-collection-calendar"
|
||||
URL = "https://www.brisbane.qld.gov.au"
|
||||
TEST_CASES = {
|
||||
"Suburban Social": {
|
||||
"suburb": "Chapel Hill",
|
||||
|
||||
@@ -4,7 +4,7 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "BSR"
|
||||
TITLE = "Berliner Stadtreinigungsbetriebe"
|
||||
DESCRIPTION = "Source for Berliner Stadtreinigungsbetriebe waste collection."
|
||||
URL = "https://bsr.de"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -8,6 +8,8 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
TITLE = "Bürgerportal"
|
||||
URL = "https://www.c-trace.de"
|
||||
DESCRIPTION = "Source for waste collection in multiple service areas."
|
||||
def EXTRA_INFO():
|
||||
return [ { "title": s["title"], "url": s["url"] } for s in SERVICE_MAP ]
|
||||
TEST_CASES = {
|
||||
"Cochem-Zell": {
|
||||
"operator": "cochem_zell",
|
||||
@@ -30,7 +32,8 @@ TEST_CASES = {
|
||||
"number": 1,
|
||||
},
|
||||
}
|
||||
ICONS = {
|
||||
|
||||
ICON_MAP = {
|
||||
"mobil": "mdi:truck",
|
||||
"bio": "mdi:leaf",
|
||||
"papier": "mdi:package-variant",
|
||||
@@ -49,12 +52,27 @@ API_HEADERS = {
|
||||
"Cache-Control": "no-cache",
|
||||
}
|
||||
Operator = Literal["cochem_zell", "alb_donau", "biedenkopf"]
|
||||
# Important: Remove the trailing slash
|
||||
OPERATOR_URLS: dict[Operator, str] = {
|
||||
"cochem_zell": "https://buerger-portal-cochemzell.azurewebsites.net",
|
||||
"alb_donau": "https://buerger-portal-albdonaukreisabfallwirtschaft.azurewebsites.net",
|
||||
"biedenkopf": "https://biedenkopfmzv.buergerportal.digital",
|
||||
}
|
||||
|
||||
SERVICE_MAP = [
|
||||
{
|
||||
"title": "KV Cochem-Zell",
|
||||
"url": "https://www.cochem-zell-online.de/",
|
||||
"api_url": "https://buerger-portal-cochemzell.azurewebsites.net/api",
|
||||
"operator": "cochem_zell"
|
||||
},
|
||||
{
|
||||
"title": "Abfallwirtschaft Alb-Donau-Kreis",
|
||||
"url": "https://www.aw-adk.de/",
|
||||
"api_url": "https://buerger-portal-albdonaukreisabfallwirtschaft.azurewebsites.net/api",
|
||||
"operator": "alb_donau"
|
||||
},
|
||||
{
|
||||
"title": "MZV Bidenkopf",
|
||||
"url": "https://mzv-biedenkopf.de/",
|
||||
"api_url": "https://biedenkopfmzv.buergerportal.digital/api",
|
||||
"operator": "biedenkopf"
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
def quote_none(value: Optional[str]) -> str:
|
||||
@@ -64,6 +82,10 @@ def quote_none(value: Optional[str]) -> str:
|
||||
return f"'{value}'"
|
||||
|
||||
|
||||
def get_api_map():
|
||||
return { s["operator"]:s["api_url"] for s in SERVICE_MAP }
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(
|
||||
self,
|
||||
@@ -73,7 +95,7 @@ class Source:
|
||||
subdistrict: Optional[str] = None,
|
||||
number: Union[int, str, None] = None,
|
||||
):
|
||||
self.api_url = f"{OPERATOR_URLS[operator]}/api"
|
||||
self.api_url = get_api_map()[operator]
|
||||
self.district = district
|
||||
self.subdistrict = subdistrict
|
||||
self.street = street
|
||||
@@ -120,7 +142,7 @@ class Source:
|
||||
icon = None
|
||||
# Maybe append collection["Abfuhrplan"]["GefaesstarifArt"]["Volumen"]["VolumenWert"] to waste type
|
||||
|
||||
for icon_type, tested_icon in ICONS.items():
|
||||
for icon_type, tested_icon in ICON_MAP.items():
|
||||
if icon_type.lower() in waste_type.lower():
|
||||
icon = tested_icon
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "C-Trace.de"
|
||||
TITLE = "C-Trace"
|
||||
DESCRIPTION = "Source for C-Trace.de."
|
||||
URL = "https://c-trace.de/"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -4,11 +4,11 @@ from datetime import datetime
|
||||
import requests
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "Cambridge.gov.uk"
|
||||
TITLE = "Cambridge City Council"
|
||||
DESCRIPTION = (
|
||||
"Source for cambridge.gov.uk services for Cambridge and part of Cambridgeshire"
|
||||
)
|
||||
URL = "cambridge.gov.uk"
|
||||
URL = "https://cambridge.gov.uk"
|
||||
TEST_CASES = {
|
||||
"houseNumber": {"post_code": "CB13JD", "number": 37},
|
||||
"houseName": {"post_code": "cb215hd", "number": "ROSEMARY HOUSE"},
|
||||
@@ -19,7 +19,7 @@ API_URLS = {
|
||||
"collection": "https://servicelayer3c.azure-api.net/wastecalendar/collection/search/{}/",
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"DOMESTIC": "mdi:trash-can",
|
||||
"RECYCLE": "mdi:recycle",
|
||||
"ORGANIC": "mdi:leaf",
|
||||
@@ -63,7 +63,7 @@ class Source:
|
||||
collection["date"], "%Y-%m-%dT%H:%M:%SZ"
|
||||
).date(),
|
||||
t=round_type.title(),
|
||||
icon=ICONS.get(round_type),
|
||||
icon=ICON_MAP.get(round_type),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "City of Canada Bay Council"
|
||||
DESCRIPTION = "Source for City of Canada Bay Council rubbish collection."
|
||||
URL = "https://www.canadabay.nsw.gov.au/residents/waste-and-recycling/my-bins/my-bin-collection"
|
||||
URL = "https://www.canadabay.nsw.gov.au"
|
||||
TEST_CASES = {
|
||||
"Harry's Shed": {
|
||||
"suburb": "Concord",
|
||||
|
||||
@@ -5,11 +5,11 @@ import json
|
||||
import requests
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "canterbury.gov.uk"
|
||||
TITLE = "Canterbury City Council"
|
||||
DESCRIPTION = (
|
||||
"Source for canterbury.gov.uk services for canterbury"
|
||||
)
|
||||
URL = "canterbury.gov.uk"
|
||||
URL = "https://canterbury.gov.uk"
|
||||
TEST_CASES = {
|
||||
"houseNumber": {"post_code": "ct68ru", "number": "63"},
|
||||
"houseName": {"post_code": "ct68ru", "number": "KOWLOON"},
|
||||
@@ -20,7 +20,7 @@ API_URLS = {
|
||||
"collection": "https://zbr7r13ke2.execute-api.eu-west-2.amazonaws.com/Beta/get-bin-dates",
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"General": "mdi:trash-can",
|
||||
"Recycling": "mdi:recycle",
|
||||
"Food": "mdi:food-apple",
|
||||
@@ -77,7 +77,7 @@ class Source:
|
||||
date, "%Y-%m-%dT%H:%M:%S"
|
||||
).date(),
|
||||
t=collection,
|
||||
icon=ICONS.get(collection),
|
||||
icon=ICON_MAP.get(collection),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from waste_collection_schedule.service.SSLError import get_legacy_session
|
||||
|
||||
TITLE = "Christchurch City Council"
|
||||
DESCRIPTION = "Source for Christchurch City Council."
|
||||
URL = "https://ccc.govt.nz/services/rubbish-and-recycling/collections"
|
||||
URL = "https://ccc.govt.nz"
|
||||
TEST_CASES = {"53 Hereford Street": {"address": "53 Hereford Street"}}
|
||||
|
||||
|
||||
|
||||
@@ -4,11 +4,9 @@ import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "cheshireeast.gov.uk"
|
||||
TITLE = "Cheshire East Council"
|
||||
DESCRIPTION = "Source for cheshireeast.gov.uk services for Cheshire East"
|
||||
URL = "cheshireeast.gov.uk"
|
||||
|
||||
|
||||
URL = "https://cheshireeast.gov.uk"
|
||||
TEST_CASES = {
|
||||
"houseUPRN": {"uprn": "100010132071"},
|
||||
"houseAddress": {"postcode": "WA16 0AY", "name_number": "1"},
|
||||
|
||||
@@ -14,12 +14,8 @@ import urllib3
|
||||
urllib3.disable_warnings()
|
||||
|
||||
|
||||
TITLE = "chesterfield.gov.uk"
|
||||
|
||||
DESCRIPTION = (
|
||||
"Source for waste collection services for Chesterfield Borough Council"
|
||||
)
|
||||
|
||||
TITLE = "Chesterfield Borough Council"
|
||||
DESCRIPTION = "Source for waste collection services for Chesterfield Borough Council"
|
||||
URL = "https://www.chesterfield.gov.uk/"
|
||||
|
||||
HEADERS = {
|
||||
@@ -33,13 +29,13 @@ TEST_CASES = {
|
||||
"Test_004": {"uprn": "74020930"},
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"DOMESTIC REFUSE": "mdi:trash-can",
|
||||
"DOMESTIC RECYCLING": "mdi:recycle",
|
||||
"DOMESTIC ORGANIC": "mdi:leaf",
|
||||
}
|
||||
|
||||
APIS = {
|
||||
API_URLS = {
|
||||
"session": "https://www.chesterfield.gov.uk/bins-and-recycling/bin-collections/check-bin-collections.aspx",
|
||||
"fwuid": "https://myaccount.chesterfield.gov.uk/anonymous/c/cbc_VE_CollectionDaysLO.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT",
|
||||
"search": "https://myaccount.chesterfield.gov.uk/anonymous/aura?r=2&aura.ApexAction.execute=1",
|
||||
@@ -57,13 +53,13 @@ class Source:
|
||||
|
||||
s = requests.Session()
|
||||
r = s.get(
|
||||
APIS["session"],
|
||||
API_URLS["session"],
|
||||
headers=HEADERS,
|
||||
)
|
||||
|
||||
# Capture fwuid value
|
||||
r = s.get(
|
||||
APIS["fwuid"],
|
||||
API_URLS["fwuid"],
|
||||
verify=False,
|
||||
headers=HEADERS,
|
||||
)
|
||||
@@ -83,7 +79,7 @@ class Source:
|
||||
"aura.token": "null",
|
||||
}
|
||||
r = s.post(
|
||||
APIS["search"],
|
||||
API_URLS["search"],
|
||||
data=payload,
|
||||
verify=False,
|
||||
headers=HEADERS,
|
||||
@@ -108,7 +104,7 @@ class Source:
|
||||
Collection(
|
||||
date=dt_local.date(),
|
||||
t=waste_type,
|
||||
icon=ICONS.get(waste_type.upper()),
|
||||
icon=ICON_MAP.get(waste_type.upper()),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ from datetime import datetime, timedelta
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Colchester.gov.uk"
|
||||
TITLE = "Colchester Borough Council"
|
||||
DESCRIPTION = "Source for Colchester.gov.uk services for the borough of Colchester, UK."
|
||||
URL = "https://colchester.gov.uk"
|
||||
TEST_CASES = {
|
||||
@@ -13,7 +13,7 @@ TEST_CASES = {
|
||||
"The Lane, Colchester": {"llpgid": "7cd96a3d-6027-e711-80fa-5065f38b56d1"},
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"Black bags": "mdi:trash-can",
|
||||
"Glass": "mdi:glass-fragile",
|
||||
"Cans": "mdi:trash-can",
|
||||
@@ -63,7 +63,7 @@ class Source:
|
||||
Collection(
|
||||
date=date.date(),
|
||||
t=day["Name"].title(),
|
||||
icon=ICONS[day["Name"]],
|
||||
icon=ICON_MAP[day["Name"]],
|
||||
)
|
||||
)
|
||||
# As Colchester.gov.uk only provides the current collection cycle, the next must be extrapolated
|
||||
@@ -73,7 +73,7 @@ class Source:
|
||||
Collection(
|
||||
date=date.date() + timedelta(days=14),
|
||||
t=day["Name"].title(),
|
||||
icon=ICONS[day["Name"]],
|
||||
icon=ICON_MAP[day["Name"]],
|
||||
)
|
||||
)
|
||||
except ValueError:
|
||||
|
||||
@@ -4,13 +4,14 @@ import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "Cornwall Council, UK"
|
||||
TITLE = "Cornwall Council"
|
||||
DESCRIPTION = "Source for cornwall.gov.uk services for Cornwall Council"
|
||||
URL = "cornwall.gov.uk"
|
||||
URL = "https://cornwall.gov.uk"
|
||||
TEST_CASES = {
|
||||
"known_uprn": {"uprn": "100040118005"},
|
||||
"unknown_uprn": {"postcode": "TR261SP", "housenumberorname": "7"},
|
||||
}
|
||||
|
||||
SEARCH_URLS = {
|
||||
"uprn_search": "https://www.cornwall.gov.uk/my-area/",
|
||||
"collection_search": "https://www.cornwall.gov.uk/umbraco/Surface/Waste/MyCollectionDays?subscribe=False",
|
||||
|
||||
@@ -5,7 +5,7 @@ from xml.dom.minidom import parseString
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "UMWELTPROFIS"
|
||||
TITLE = "Umweltprofis"
|
||||
DESCRIPTION = "Source for Umweltprofis"
|
||||
URL = "https://www.umweltprofis.at"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -6,9 +6,9 @@ import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Derby.gov.uk"
|
||||
TITLE = "Derby City Council"
|
||||
DESCRIPTION = "Source for Derby.gov.uk services for Derby City Council, UK."
|
||||
URL = "https://secure.derby.gov.uk/binday/"
|
||||
URL = "https://derby.gov.uk"
|
||||
TEST_CASES = {
|
||||
# Derby City council wants specific addresses, hopefully these are generic enough.
|
||||
"Community Of The Holy Name, Morley Road, Derby, DE21 4TB": {
|
||||
@@ -20,7 +20,7 @@ TEST_CASES = {
|
||||
},
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"Black bin": "mdi:trash-can",
|
||||
"Blue bin": "mdi:recycle",
|
||||
"Brown bin": "mdi:leaf",
|
||||
@@ -82,7 +82,7 @@ class Source:
|
||||
Collection(
|
||||
date=date,
|
||||
t=collection_type,
|
||||
icon=ICONS[collection_type],
|
||||
icon=ICON_MAP[collection_type],
|
||||
)
|
||||
)
|
||||
return entries
|
||||
|
||||
@@ -3,8 +3,9 @@ from ..collection import Collection
|
||||
|
||||
from ..service.EcoHarmonogramPL import Ecoharmonogram
|
||||
|
||||
TITLE = "Ecoharmonogram"
|
||||
DESCRIPTION = "Source for ecoharmonogram.pl"
|
||||
URL = "ecoharmonogram.pl"
|
||||
URL = "https://ecoharmonogram.pl"
|
||||
TEST_CASES = {
|
||||
"Simple test case": {"town": "Krzeszowice", "street": "Wyki", "house_number": ""},
|
||||
"Sides multi test case": {"town": "Częstochowa", "street": "Boczna", "additional_sides_matcher": "wie"},
|
||||
@@ -14,7 +15,6 @@ TEST_CASES = {
|
||||
"additional_sides_matcher": "Wielorodzinna - powyżej 7 lokali"},
|
||||
"Simple test with community": {"town": "Gdańsk", "street": "Jabłoniowa", "house_number": "55", "additional_sides_matcher": "", "community": "108" },
|
||||
}
|
||||
TITLE = "ecoharmonogram.pl"
|
||||
|
||||
|
||||
class Source:
|
||||
|
||||
@@ -7,7 +7,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "EGN Abfallkalender"
|
||||
DESCRIPTION = "Source for EGN Abfallkalender"
|
||||
URL = "https://www.egn-abfallkalender.de/kalender"
|
||||
URL = "https://www.egn-abfallkalender.de"
|
||||
TEST_CASES = {
|
||||
"Grevenbroich": {
|
||||
"city": "Grevenbroich",
|
||||
@@ -31,7 +31,8 @@ TEST_CASES = {
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
IconMap = {
|
||||
API_URL = "https://www.egn-abfallkalender.de/kalender"
|
||||
ICON_MAP = {
|
||||
"Grau": "mdi:trash-can",
|
||||
"Gelb": "mdi:sack",
|
||||
"Blau": "mdi:package-variant",
|
||||
@@ -48,7 +49,7 @@ class Source:
|
||||
|
||||
def fetch(self):
|
||||
s = requests.session()
|
||||
r = s.get(URL)
|
||||
r = s.get(API_URL)
|
||||
|
||||
soup = BeautifulSoup(r.text, features="html.parser")
|
||||
tag = soup.find("meta", {"name": "csrf-token"})
|
||||
@@ -62,7 +63,7 @@ class Source:
|
||||
"street": self._street,
|
||||
"street_number": self._housenumber,
|
||||
}
|
||||
r = s.post(URL, data=post_data, headers=headers)
|
||||
r = s.post(API_URL, data=post_data, headers=headers)
|
||||
|
||||
data = r.json()
|
||||
|
||||
@@ -85,7 +86,7 @@ class Source:
|
||||
.capitalize()
|
||||
)
|
||||
entries.append(
|
||||
Collection(date=date, t=color, icon=IconMap.get(color))
|
||||
Collection(date=date, t=color, icon=ICON_MAP.get(color))
|
||||
)
|
||||
|
||||
return entries
|
||||
|
||||
@@ -5,15 +5,9 @@ import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "elmbridge.gov.uk"
|
||||
TITLE = "Elmbridge Borough Council"
|
||||
DESCRIPTION = "Source for waste collection services for Elmbridge Borough Council"
|
||||
URL = "https://www.elmbridge.gov.uk/waste-and-recycling/"
|
||||
|
||||
|
||||
HEADERS = {
|
||||
"user-agent": "Mozilla/5.0",
|
||||
}
|
||||
|
||||
URL = "https://www.elmbridge.gov.uk"
|
||||
TEST_CASES = {
|
||||
"Test_001": {"uprn": 10013119164},
|
||||
"Test_002": {"uprn": "100061309206"},
|
||||
@@ -38,13 +32,17 @@ OFFSETS = {
|
||||
"Sunday": 6,
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"REFUSE": "mdi:trash-can",
|
||||
"RECYCLING": "mdi:recycle",
|
||||
"FOOD": "mdi:food",
|
||||
"GARDEN": "mdi:leaf",
|
||||
}
|
||||
|
||||
HEADERS = {
|
||||
"user-agent": "Mozilla/5.0",
|
||||
}
|
||||
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -117,7 +115,7 @@ class Source:
|
||||
Collection(
|
||||
date=new_date.date(),
|
||||
t=waste + " bin",
|
||||
icon=ICONS.get(waste.upper()),
|
||||
icon=ICON_MAP.get(waste.upper()),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -5,24 +5,31 @@ from bs4 import BeautifulSoup
|
||||
from dateutil.parser import parse
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "environmentfirst.co.uk"
|
||||
|
||||
TITLE = "Environment First"
|
||||
URL = "https://environmentfirst.co.uk"
|
||||
EXTRA_INFO = [
|
||||
{
|
||||
"title": "Eastbourne Borough Council",
|
||||
"url": "https://lewes-eastbourne.gov.uk"
|
||||
},
|
||||
{
|
||||
"title": "Lewes District Council",
|
||||
"url": "https://lewes-eastbourne.gov.uk"
|
||||
},
|
||||
]
|
||||
DESCRIPTION = (
|
||||
"""Consolidated source for waste collection services from:
|
||||
Eastbourne Borough Council
|
||||
Lewes District Council
|
||||
"""
|
||||
)
|
||||
|
||||
URL = "https://environmentfirst.co.uk"
|
||||
|
||||
TEST_CASES = {
|
||||
"houseUPRN" : {"uprn": "100060063421"},
|
||||
"houseNumber": {"post_code": "BN228SG", "number": 3},
|
||||
"houseName": {"post_code": "BN73LG", "number": "Garden Cottage"},
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"RUBBISH": "mdi:trash-can",
|
||||
"RECYCLING": "mdi:recycle",
|
||||
"GARDEN WASTE": "mdi:leaf",
|
||||
@@ -92,13 +99,13 @@ class Source:
|
||||
x = soup.findAll("p")
|
||||
for i in x[1:-1]: # ignores elements containing address and marketing message
|
||||
if " day " in i.text:
|
||||
for round_type in ICONS:
|
||||
for round_type in ICON_MAP:
|
||||
if round_type in i.text.upper():
|
||||
entries.append(
|
||||
Collection(
|
||||
date = parse(str.split(i.text, ":")[1]).date(),
|
||||
t = round_type,
|
||||
icon = ICONS.get(round_type),
|
||||
icon = ICON_MAP.get(round_type),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -5,8 +5,7 @@ from bs4 import BeautifulSoup
|
||||
from dateutil import parser
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "fccenvironment.co.uk"
|
||||
|
||||
TITLE = "FCC Environment"
|
||||
DESCRIPTION = """
|
||||
Consolidated source for waste collection services for ~60 local authorities.
|
||||
Currently supports:
|
||||
@@ -14,8 +13,21 @@ DESCRIPTION = """
|
||||
South Hams (Generic Provider)
|
||||
Market Harborough (Custom Provider)
|
||||
"""
|
||||
|
||||
URL = "https://fccenvironment.co.uk"
|
||||
EXTRA_INFO = [
|
||||
{
|
||||
"title": "Harborough District Council",
|
||||
"url": "https://harborough.gov.uk"
|
||||
},
|
||||
{
|
||||
"title": "South Hams District Council",
|
||||
"url": "https://southhams.gov.uk/"
|
||||
},
|
||||
{
|
||||
"title": "West Devon Borough Council",
|
||||
"url": "https://www.westdevon.gov.uk/"
|
||||
},
|
||||
]
|
||||
|
||||
TEST_CASES = {
|
||||
"14_LE16_9QX": {"uprn": "100030491624"}, # region ommited to test default values
|
||||
@@ -28,7 +40,7 @@ TEST_CASES = {
|
||||
"4_SL21_0HZ": {"uprn": "100040281987", "region": "southhams"},
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"Refuse": "mdi:trash-can",
|
||||
"Recycling": "mdi:recycle",
|
||||
"Garden": "mdi:leaf",
|
||||
@@ -66,7 +78,7 @@ class Source:
|
||||
"""
|
||||
Handle duplication before creating the list of Collections
|
||||
"""
|
||||
for type in ICONS:
|
||||
for type in ICON_MAP:
|
||||
if type in service:
|
||||
if type in results.keys():
|
||||
if date < results[type]:
|
||||
@@ -80,7 +92,7 @@ class Source:
|
||||
Collection(
|
||||
date=results[result],
|
||||
t=result,
|
||||
icon=ICONS[result],
|
||||
icon=ICON_MAP[result],
|
||||
)
|
||||
)
|
||||
return entries
|
||||
|
||||
@@ -4,7 +4,7 @@ from datetime import datetime
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Grafikai.svara.lt"
|
||||
TITLE = "Kauno švara"
|
||||
DESCRIPTION = 'Source for UAB "Kauno švara".'
|
||||
URL = "http://grafikai.svara.lt"
|
||||
TEST_CASES = {
|
||||
@@ -22,7 +22,7 @@ TEST_CASES = {
|
||||
},
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"mišrių atliekų": "mdi:trash-can",
|
||||
"antrinių žaliavų (popierius/plastikas)": "mdi:recycle",
|
||||
"antrinių žaliavų (stiklas)": "mdi:glass-fragile",
|
||||
@@ -86,7 +86,7 @@ class Source:
|
||||
collection_waste_object["date"], "%Y-%m-%dT%H:%M:%S"
|
||||
).date(),
|
||||
t=collection["descriptionFmt"].title(),
|
||||
icon=ICONS.get(type, "mdi:trash-can"),
|
||||
icon=ICON_MAP.get(type, "mdi:trash-can"),
|
||||
)
|
||||
)
|
||||
except ValueError:
|
||||
|
||||
@@ -4,9 +4,8 @@ from datetime import datetime
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "guildford.gov.uk"
|
||||
TITLE = "Guildford Borough Council"
|
||||
DESCRIPTION = "Source for guildford.gov.uk services for Guildford, UK."
|
||||
# Find the UPRN of your address using https://www.findmyaddress.co.uk/search
|
||||
URL = "https://guildford.gov.uk"
|
||||
TEST_CASES = {
|
||||
"GU12": {"uprn": "10007060305"},
|
||||
@@ -14,7 +13,7 @@ TEST_CASES = {
|
||||
"GU2": {"uprn": "100061391831"},
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"Refuse": "mdi:trash-can",
|
||||
"Food": "mdi:food-apple",
|
||||
"Recycling": "mdi:recycle",
|
||||
@@ -74,7 +73,7 @@ class Source:
|
||||
collection["NextDate"], "%Y-%m-%dT%H:%M:%S.000Z"
|
||||
).date(),
|
||||
t=collection["FeatureName"],
|
||||
icon=ICONS[collection["FeatureName"]],
|
||||
icon=ICON_MAP[collection["FeatureName"]],
|
||||
)
|
||||
)
|
||||
except ValueError:
|
||||
|
||||
@@ -4,7 +4,7 @@ from datetime import datetime
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Huntingdonshire.gov.uk"
|
||||
TITLE = "Huntingdonshire District Council"
|
||||
DESCRIPTION = "Source for Huntingdonshire.gov.uk services for Huntingdonshire District Council."
|
||||
URL = "https://www.huntingdonshire.gov.uk"
|
||||
TEST_CASES = {
|
||||
@@ -12,7 +12,7 @@ TEST_CASES = {
|
||||
"Inkerman Rise, St. Neots": {"uprn": "10000144271"},
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"Refuse": "mdi:trash-can",
|
||||
"Recycling": "mdi:recycle",
|
||||
"Garden": "mdi:leaf",
|
||||
@@ -45,7 +45,7 @@ class Source:
|
||||
collection["date"], "%Y-%m-%dT%H:%M:%SZ"
|
||||
).date(),
|
||||
t=round_type.title(),
|
||||
icon=ICONS.get(round_type),
|
||||
icon=ICON_MAP.get(round_type),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -4,9 +4,11 @@ from datetime import datetime
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "HVCGroep"
|
||||
TITLE = None
|
||||
DESCRIPTION = "Source for the Dutch HVCGroep waste management."
|
||||
URL = "https://www.hvcgroep.nl/zelf-regelen/afvalkalender"
|
||||
URL = "https://www.hvcgroep.nl"
|
||||
def EXTRA_INFO():
|
||||
return [ { "title": s["title"], "url": get_main_url(s["api_url"])} for s in SERVICE_MAP ]
|
||||
TEST_CASES = {
|
||||
"Tollebeek": {"postal_code": "8309AV", "house_number": "1"},
|
||||
"Hvgroep: Tollebeek": {
|
||||
@@ -15,39 +17,105 @@ TEST_CASES = {
|
||||
"service": "hvcgroep",
|
||||
},
|
||||
"Cyclus": {"postal_code": "2841ML", "house_number": "1090", "service": "cyclusnv"},
|
||||
"Mjinblink": {
|
||||
"Mijnblink": {
|
||||
"postal_code": "5741BV",
|
||||
"house_number": "76",
|
||||
"service": "mjinblink",
|
||||
"service": "mijnblink",
|
||||
},
|
||||
}
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SERVICE_MAP = {
|
||||
"alphenaandenrijn": "https://afvalkalender.alphenaandenrijn.nl",
|
||||
"cranendonck": "https://afvalkalender.cranendonck.nl",
|
||||
"cyclusnv": "https://afvalkalender.cyclusnv.nl",
|
||||
"dar": "https://afvalkalender.dar.nl",
|
||||
"denhaag": "https://huisvuilkalender.denhaag.nl",
|
||||
"gad": "https://inzamelkalender.gad.nl",
|
||||
"gemeenteberkelland": "https://afvalkalender.gemeenteberkelland.nl",
|
||||
"hvcgroep": "https://inzamelkalender.hvcgroep.nl",
|
||||
"lingewaard": "https://afvalwijzer.lingewaard.nl",
|
||||
"middelburgvlissingen": "https://afvalwijzer.middelburgvlissingen.nl",
|
||||
"mijnblink": "https://mijnblink.nl",
|
||||
"peelenmaas": "https://afvalkalender.peelenmaas.nl",
|
||||
"prezero": "https://inzamelwijzer.prezero.nl",
|
||||
"purmerend": "https://afvalkalender.purmerend.nl",
|
||||
"rmn": "https://inzamelschema.rmn.nl",
|
||||
"schouwen-duiveland": "https://afvalkalender.schouwen-duiveland.nl",
|
||||
"spaarnelanden": "https://afvalwijzer.spaarnelanden.nl",
|
||||
"stadswerk072": "https://www.stadswerk072.nl",
|
||||
"sudwestfryslan": "https://afvalkalender.sudwestfryslan.nl",
|
||||
"venray": "https://afvalkalender.venray.nl",
|
||||
"voorschoten": "https://afvalkalender.voorschoten.nl",
|
||||
"waalre": "https://afvalkalender.waalre.nl",
|
||||
"zrd": "https://afvalkalender.zrd.nl",
|
||||
SERVICE_MAP = [
|
||||
{ "title": "Alpen an den Rijn",
|
||||
"api_url": "https://afvalkalender.alphenaandenrijn.nl",
|
||||
},
|
||||
{ "title": "Gemeente Cranendonck",
|
||||
"api_url": "https://afvalkalender.cranendonck.nl",
|
||||
},
|
||||
{ "title": "Cyclus NV",
|
||||
"api_url": "https://afvalkalender.cyclusnv.nl",
|
||||
},
|
||||
{ "title": "Dar",
|
||||
"api_url": "https://afvalkalender.dar.nl",
|
||||
},
|
||||
{ "title": "Den Haag",
|
||||
"api_url": "https://huisvuilkalender.denhaag.nl",
|
||||
},
|
||||
{ "title": "GAD",
|
||||
"api_url": "https://inzamelkalender.gad.nl",
|
||||
},
|
||||
{ "title": "Gemeente Berkelland",
|
||||
"api_url": "https://afvalkalender.gemeenteberkelland.nl",
|
||||
},
|
||||
{ "title": "HVC Groep",
|
||||
"api_url": "https://inzamelkalender.hvcgroep.nl",
|
||||
},
|
||||
{ "title": "Gemeente Lingewaard",
|
||||
"api_url": "https://afvalwijzer.lingewaard.nl",
|
||||
},
|
||||
{ "title": "Gemeente Middelburg + Vlissingen",
|
||||
"api_url": "https://afvalwijzer.middelburgvlissingen.nl",
|
||||
},
|
||||
{ "title": "Mijn Blink",
|
||||
"api_url": "https://mijnblink.nl",
|
||||
},
|
||||
{ "title": "Gemeente Peel en Maas",
|
||||
"api_url": "https://afvalkalender.peelenmaas.nl",
|
||||
},
|
||||
{ "title": "PreZero",
|
||||
"api_url": "https://inzamelwijzer.prezero.nl",
|
||||
},
|
||||
{ "title": "Purmerend",
|
||||
"api_url": "https://afvalkalender.purmerend.nl",
|
||||
},
|
||||
{ "title": "Reinigingsbedrijf Midden Nederland",
|
||||
"api_url": "https://inzamelschema.rmn.nl",
|
||||
},
|
||||
{ "title": "Gemeente Schouwen-Duiveland",
|
||||
"api_url": "https://afvalkalender.schouwen-duiveland.nl",
|
||||
},
|
||||
{ "title": "Spaarne Landen",
|
||||
"api_url": "https://afvalwijzer.spaarnelanden.nl",
|
||||
},
|
||||
{ "title": "Stadswerk 072",
|
||||
"api_url": "https://www.stadswerk072.nl",
|
||||
},
|
||||
{ "title": "Gemeente Sudwest-Fryslan",
|
||||
"api_url": "https://afvalkalender.sudwestfryslan.nl",
|
||||
},
|
||||
{ "title": "Gemeente Venray",
|
||||
"api_url": "https://afvalkalender.venray.nl",
|
||||
},
|
||||
{ "title": "Gemeente Voorschoten",
|
||||
"api_url": "https://afvalkalender.voorschoten.nl",
|
||||
},
|
||||
{ "title": "Gemeente Wallre",
|
||||
"api_url": "https://afvalkalender.waalre.nl",
|
||||
},
|
||||
{ "title": "ZRD",
|
||||
"api_url": "https://afvalkalender.zrd.nl",
|
||||
},
|
||||
]
|
||||
|
||||
def get_service_name_map():
|
||||
def extract_service_name(api_url):
|
||||
name = api_url.split(".")[-2]
|
||||
name = name.split("/")[-1]
|
||||
return name
|
||||
|
||||
return { extract_service_name(s["api_url"]):s["api_url"] for s in SERVICE_MAP }
|
||||
|
||||
def get_main_url(url):
|
||||
x = url.split(".")[-2:]
|
||||
x[0] = x[0].removeprefix("https://")
|
||||
return "https://" + ".".join(x)
|
||||
|
||||
ICON_MAP = {
|
||||
"plastic-blik-drinkpak": "mdi:recycle",
|
||||
"gft": "mdi:leaf",
|
||||
"papier-en-karton": "mdi:archive",
|
||||
"restafval": "mdi:trash-can",
|
||||
}
|
||||
|
||||
|
||||
@@ -55,13 +123,7 @@ class Source:
|
||||
def __init__(self, postal_code, house_number, service="hvcgroep"):
|
||||
self.postal_code = postal_code
|
||||
self.house_number = house_number
|
||||
self.icons = {
|
||||
"plastic-blik-drinkpak": "mdi:recycle",
|
||||
"gft": "mdi:leaf",
|
||||
"papier-en-karton": "mdi:archive",
|
||||
"restafval": "mdi:trash-can",
|
||||
}
|
||||
self._url = SERVICE_MAP[service]
|
||||
self._url = get_service_name_map()[service]
|
||||
|
||||
def fetch(self):
|
||||
|
||||
@@ -97,7 +159,7 @@ class Source:
|
||||
Collection(
|
||||
date=datetime.strptime(item["ophaaldatum"], "%Y-%m-%d").date(),
|
||||
t=waste_details[0]["title"],
|
||||
icon=self.icons.get(waste_details[0]["icon"], "mdi:trash-can"),
|
||||
icon=ICON_MAP.get(waste_details[0]["icon"], "mdi:trash-can"),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -6,9 +6,16 @@ from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
TITLE = "INFEO"
|
||||
TITLE = "infeo"
|
||||
DESCRIPTION = "Source for INFEO waste collection."
|
||||
URL = "https://www.infeo.at/"
|
||||
EXTRA_INFO = [
|
||||
{
|
||||
"title": "Bogenschütz Entsorgung",
|
||||
"url": "https://bogenschuetz-entsorgung.de",
|
||||
"country": "de",
|
||||
},
|
||||
]
|
||||
TEST_CASES = {"Bogenschütz": {"customer": "bogenschütz", "zone": "Dettenhausen"}}
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Inner West Council (NSW)"
|
||||
DESCRIPTION = "Source for Inner West Council (NSW) rubbish collection."
|
||||
URL = "https://www.innerwest.nsw.gov.au/live/waste-and-recycling/bins-and-clean-ups/waste-calendar"
|
||||
URL = "https://www.innerwest.nsw.gov.au"
|
||||
TEST_CASES = {
|
||||
"Random address": {
|
||||
"suburb": "Tempe",
|
||||
|
||||
@@ -7,14 +7,14 @@ from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "Ipswich City Council"
|
||||
DESCRIPTION = "Source for Ipswich City Council rubbish collection."
|
||||
URL = "https://www.ipswich.qld.gov.au/live/waste-and-recycling/bin-collection-calendar"
|
||||
URL = "https://www.ipswich.qld.gov.au"
|
||||
TEST_CASES = {
|
||||
"Camira State School": {"street": "184-202 Old Logan Rd", "suburb": "Camira"},
|
||||
"Random": {"street": "50 Brisbane Road", "suburb": "Redbank"},
|
||||
}
|
||||
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"Waste Bin": "mdi:trash-can",
|
||||
"Recycle Bin": "mdi:recycle",
|
||||
"FOGO Bin": "mdi:leaf",
|
||||
@@ -91,7 +91,7 @@ class IpswichGovAuParser(HTMLParser):
|
||||
|
||||
self._entries.append(
|
||||
Collection(
|
||||
self._loaded_date, data, icon=ICONS.get(data, "mdi:trash-can")
|
||||
self._loaded_date, data, icon=ICON_MAP.get(data, "mdi:trash-can")
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "KAEV Niederlausitz"
|
||||
DESCRIPTION = "Source for Kommunaler Abfallverband niederlausitz waste collection."
|
||||
DESCRIPTION = "Source for Kommunaler Abfallverband Niederlausitz waste collection."
|
||||
URL = "https://www.kaev.de/"
|
||||
URL_ADDRESS = 'https://www.kaev.de/Templates/Content/DetailTourenplanWebsite/ajax.aspx/getAddress'
|
||||
COUNTRY = "de"
|
||||
TEST_CASES = {
|
||||
"Luckau / OT Zieckau": {
|
||||
"abf_suche": "Luckau / OT Zieckau",
|
||||
@@ -21,11 +21,13 @@ TEST_CASES = {
|
||||
},
|
||||
}
|
||||
|
||||
API_URL = 'https://www.kaev.de/Templates/Content/DetailTourenplanWebsite/ajax.aspx/getAddress'
|
||||
|
||||
def get_kalender_id(search):
|
||||
s=requests.Session()
|
||||
s.get('https://www.kaev.de/')
|
||||
payload={"query": search}
|
||||
resp = s.post(URL_ADDRESS, json=payload).json()
|
||||
resp = s.post(API_URL, json=payload).json()
|
||||
abf_cal = json.loads(resp["d"])
|
||||
return abf_cal
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@ from datetime import datetime
|
||||
import requests
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "www.kingston.gov.uk"
|
||||
TITLE = "The Royal Borough of Kingston Council"
|
||||
DESCRIPTION = (
|
||||
"Source for waste collection services for The Royal Borough of Kingston Council"
|
||||
)
|
||||
URL = "https://kingston-self.achieveservice.com/service/in_my_area?displaymode=collections"
|
||||
URL = "kingston.gov.uk"
|
||||
|
||||
|
||||
HEADERS = {
|
||||
|
||||
@@ -6,9 +6,14 @@ from bs4 import BeautifulSoup
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS # type: ignore[attr-defined]
|
||||
|
||||
TITLE = 'Müllabfuhr Korneuburg'
|
||||
TITLE = 'Stadtservice Korneuburg'
|
||||
DESCRIPTION = 'Source for Stadtservice Korneuburg'
|
||||
URL = 'https://www.korneuburg.gv.at'
|
||||
TEST_CASES = {
|
||||
"Rathaus": {"street_name": "Hauptplatz", "street_number": 39}, # Teilgebiet 4
|
||||
"Rathaus using Teilgebiet": {"street_name": "SomeStreet", "street_number": "1A", "teilgebiet": "4"}, # Teilgebiet 4
|
||||
"Werft": {"street_name": "Am Hafen", "street_number": 6} # Teilgebiet 2
|
||||
}
|
||||
|
||||
# Mapping of teilgebiete to calendar urls
|
||||
WASTE_TYPE_URLS = {
|
||||
@@ -18,12 +23,6 @@ WASTE_TYPE_URLS = {
|
||||
'4': ('Biomuell_2', 'Restmuell', 'Papier', 'Gelber_Sack_3')
|
||||
}
|
||||
|
||||
TEST_CASES = {
|
||||
"Rathaus": {"street_name": "Hauptplatz", "street_number": 39}, # Teilgebiet 4
|
||||
"Rathaus using Teilgebiet": {"street_name": "SomeStreet", "street_number": "1A", "teilgebiet": "4"}, # Teilgebiet 4
|
||||
"Werft": {"street_name": "Am Hafen", "street_number": 6} # Teilgebiet 2
|
||||
}
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(self, street_name, street_number, teilgebiet=-1):
|
||||
|
||||
@@ -2,9 +2,9 @@ import requests
|
||||
from waste_collection_schedule import Collection
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "KreisWirtschaftsBetriebe Goslar"
|
||||
TITLE = "Kreiswirtschaftsbetriebe Goslar"
|
||||
DESCRIPTION = "Source for kwb-goslar.de waste collection."
|
||||
URL = "https://www.kwb-goslar.de/Abfallwirtschaft/Abfuhr/"
|
||||
URL = "https://www.kwb-goslar.de"
|
||||
TEST_CASES = {
|
||||
"Berliner Straße (Clausthal-Zellerfeld)": {"pois": "2523.602"},
|
||||
"Braunschweiger Straße (Seesen)": {"pois": "2523.409"},
|
||||
|
||||
@@ -7,13 +7,18 @@ from waste_collection_schedule.service.ICS import ICS
|
||||
TITLE = "KWU Entsorgung Landkreis Oder-Spree"
|
||||
DESCRIPTION = "Source for KWU Entsorgung, Germany"
|
||||
URL = "https://www.kwu-entsorgung.de/"
|
||||
|
||||
TEST_CASES = {
|
||||
"Erkner": {"city": "Erkner", "street": "Heinrich-Heine-Straße", "number": "11"},
|
||||
"Bad Saarow": {"city": "Bad Saarow", "street": "Ahornallee", "number": "1"}
|
||||
}
|
||||
|
||||
HEADERS = {"user-agent": "Mozilla/5.0 (xxxx Windows NT 10.0; Win64; x64)"}
|
||||
ICON_MAP = {
|
||||
"Restabfall": "mdi:trash-can-outline",
|
||||
"Gelber Sack" : "mdi:recycle",
|
||||
"Papiertonne" : "mdi:package-variant",
|
||||
"Biotonne": "mdi:food-apple-outline",
|
||||
}
|
||||
|
||||
|
||||
class Source:
|
||||
@@ -22,12 +27,6 @@ class Source:
|
||||
self._street = street
|
||||
self._number = number
|
||||
self._ics = ICS()
|
||||
self._iconMap = {
|
||||
"Restabfall": "mdi:trash-can-outline",
|
||||
"Gelber Sack" : "mdi:recycle",
|
||||
"Papiertonne" : "mdi:package-variant",
|
||||
"Biotonne": "mdi:food-apple-outline",
|
||||
}
|
||||
|
||||
def fetch(self):
|
||||
session = requests.Session()
|
||||
@@ -94,7 +93,7 @@ class Source:
|
||||
waste_type = d[1].strip()
|
||||
next_pickup_date = d[0]
|
||||
|
||||
entries.append(Collection(date=next_pickup_date, t=waste_type, icon=self._iconMap.get(waste_type,"mdi:trash-can")))
|
||||
entries.append(Collection(date=next_pickup_date, t=waste_type, icon=ICON_MAP.get(waste_type,"mdi:trash-can")))
|
||||
|
||||
return entries
|
||||
|
||||
|
||||
@@ -3,18 +3,10 @@ import datetime
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Source for Rhön Grabfeld"
|
||||
TITLE = "Landkreis Rhön Grabfeld"
|
||||
DESCRIPTION = "Source for Rhönn Grabfeld uses service by offizium."
|
||||
URL = 'https://fs-api-rg.offizium.com/abfalltermine'
|
||||
ICON_MAP = {
|
||||
"Restmüll/Gelber Sack/Biotonne": "mdi:trash-can",
|
||||
"Papiersammlung": "mdi:package-variant",
|
||||
"Problemmüllsammlung": "mdi:biohazard"
|
||||
}
|
||||
EVENT_BLACKLIST = ['Wertstoffhof Mellrichstadt',
|
||||
'Wertstoffhof Bad Königshofen', 'Wertstoffzentrum Bad Neustadt',
|
||||
'Wertstoffsammelstelle Ostheim',
|
||||
'Wertstoffsammelstelle Bischofsheim']
|
||||
URL = "https://www.abfallinfo-rhoen-grabfeld.de/"
|
||||
COUNTRY = "de"
|
||||
TEST_CASES = {
|
||||
"City only": {"city": "Ostheim"},
|
||||
"City + District": {"city": "Ostheim", "district": "Oberwaldbehrungen"},
|
||||
@@ -22,6 +14,19 @@ TEST_CASES = {
|
||||
"empty": {}
|
||||
}
|
||||
|
||||
API_URL = 'https://fs-api-rg.offizium.com/abfalltermine'
|
||||
|
||||
EVENT_BLACKLIST = ['Wertstoffhof Mellrichstadt',
|
||||
'Wertstoffhof Bad Königshofen', 'Wertstoffzentrum Bad Neustadt',
|
||||
'Wertstoffsammelstelle Ostheim',
|
||||
'Wertstoffsammelstelle Bischofsheim']
|
||||
|
||||
ICON_MAP = {
|
||||
"Restmüll/Gelber Sack/Biotonne": "mdi:trash-can",
|
||||
"Papiersammlung": "mdi:package-variant",
|
||||
"Problemmüllsammlung": "mdi:biohazard"
|
||||
}
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(self, city: str = None, district: str = None):
|
||||
@@ -31,7 +36,7 @@ class Source:
|
||||
def fetch(self):
|
||||
now = datetime.datetime.now().date()
|
||||
|
||||
r = requests.get(URL, params={
|
||||
r = requests.get(API_URL, params={
|
||||
"stadt": self._city,
|
||||
"ortsteil": self._district
|
||||
})
|
||||
|
||||
@@ -4,12 +4,9 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
TITLE = "Landkreis-Wittmund.de"
|
||||
TITLE = "Landkreis Wittmund"
|
||||
DESCRIPTION = "Source for Landkreis Wittmund waste collection."
|
||||
URL = "https://www.landkreis-wittmund.de/Leben-Wohnen/Wohnen/Abfall/Abfuhrkalender/"
|
||||
AUTOCOMPLETE_URL = "https://www.landkreis-wittmund.de/output/autocomplete.php?out=json&type=abto&mode=&select=2&refid={}&term="
|
||||
DOWNLOAD_URL = "https://www.landkreis-wittmund.de/output/options.php?ModID=48&call=ical&ArtID%5B0%5D=3105.1&ArtID%5B1%5D=1.4&ArtID%5B2%5D=1.2&ArtID%5B3%5D=1.3&ArtID%5B4%5D=1.1&pois={}&alarm=0"
|
||||
|
||||
URL = "https://www.landkreis-wittmund.de"
|
||||
TEST_CASES = {
|
||||
"CityWithoutStreet": {
|
||||
"city": "Werdum",
|
||||
@@ -20,6 +17,11 @@ TEST_CASES = {
|
||||
},
|
||||
}
|
||||
|
||||
API_URL = "https://www.landkreis-wittmund.de/Leben-Wohnen/Wohnen/Abfall/Abfuhrkalender/"
|
||||
AUTOCOMPLETE_URL = "https://www.landkreis-wittmund.de/output/autocomplete.php?out=json&type=abto&mode=&select=2&refid={}&term="
|
||||
DOWNLOAD_URL = "https://www.landkreis-wittmund.de/output/options.php?ModID=48&call=ical&ArtID%5B0%5D=3105.1&ArtID%5B1%5D=1.4&ArtID%5B2%5D=1.2&ArtID%5B3%5D=1.3&ArtID%5B4%5D=1.1&pois={}&alarm=0"
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(self, city, street=None):
|
||||
self._city = city
|
||||
@@ -36,11 +38,11 @@ class Source:
|
||||
return tag['value'] != "" and tag.string == self._city
|
||||
|
||||
def fetch_city_id(self, cityName):
|
||||
r = requests.get(URL)
|
||||
r = requests.get(API_URL)
|
||||
if not r.ok:
|
||||
raise Exception(
|
||||
"Error: failed to fetch url: {}".format(
|
||||
URL
|
||||
API_URL
|
||||
)
|
||||
)
|
||||
|
||||
@@ -64,7 +66,7 @@ class Source:
|
||||
|
||||
def fetch_street_id(self, cityId, streetName):
|
||||
r = requests.get(AUTOCOMPLETE_URL.format(cityId, streetName), headers={
|
||||
"Referer": URL
|
||||
"Referer": API_URL
|
||||
})
|
||||
|
||||
if not r.ok:
|
||||
@@ -100,7 +102,7 @@ class Source:
|
||||
|
||||
def fetch_ics(self, url):
|
||||
r = requests.get(url, headers={
|
||||
"Referer": URL
|
||||
"Referer": API_URL
|
||||
})
|
||||
|
||||
if not r.ok:
|
||||
|
||||
@@ -8,7 +8,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Lerum Vatten och Avlopp"
|
||||
DESCRIPTION = "Source for Lerum Vatten och Avlopp waste collection."
|
||||
URL = "https://vatjanst.lerum.se/FutureWeb/SimpleWastePickup/SimpleWastePickup"
|
||||
URL = "https://vatjanst.lerum.se"
|
||||
TEST_CASES = {
|
||||
"PRO": {"street_address": "Floda stationsväg 5, Floda"},
|
||||
"Polisen": {"street_address": "Göteborgsvägen 16, Lerum"},
|
||||
|
||||
@@ -9,8 +9,7 @@ TITLE = "London Borough of Lewisham"
|
||||
DESCRIPTION = (
|
||||
"Source for services from the London Borough of Lewisham"
|
||||
)
|
||||
|
||||
URL = "lewisham.gov.uk"
|
||||
URL = "https://lewisham.gov.uk"
|
||||
TEST_CASES = {
|
||||
"houseNumber": {"post_code": "SE41LR", "number": 4},
|
||||
"houseName": {"post_code": "SE233TE", "name": "The Haven"},
|
||||
|
||||
@@ -5,16 +5,16 @@ import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Abfall Lindau"
|
||||
TITLE = "Lindau"
|
||||
DESCRIPTION = "Source for Lindau waste collection."
|
||||
URL = "https://www.lindau.ch/abfalldaten"
|
||||
URL = "https://www.lindau.ch"
|
||||
TEST_CASES = {
|
||||
"Tagelswangen": {"city": "Tagelswangen"},
|
||||
"Grafstal": {"city": "190"},
|
||||
}
|
||||
|
||||
|
||||
IconMap = {
|
||||
ICON_MAP = {
|
||||
"kehricht": "mdi:trash-can",
|
||||
"grungut": "mdi:leaf",
|
||||
"hackseldienst": "mdi:leaf",
|
||||
@@ -51,7 +51,7 @@ class Source:
|
||||
Collection(
|
||||
date=next_pickup_date,
|
||||
t=waste_type,
|
||||
icon=IconMap.get(waste_type_sorted, "mdi:trash-can"),
|
||||
icon=ICON_MAP.get(waste_type_sorted, "mdi:trash-can"),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -6,13 +6,12 @@ from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "Landkreis Schwäbisch Hall"
|
||||
DESCRIPTION = "Source for lrasha.de - Landkreis Schwäbisch Hall"
|
||||
URL = "http://exchange.cmcitymedia.de/landkreis-schwaebisch-hallt3/wasteCalendarExport.php?location="
|
||||
# https://www.lrasha.de/de/buergerservice/abfallwirtschaft/abfallkalender
|
||||
|
||||
URL = "https://www.lrasha.de"
|
||||
TEST_CASES = {
|
||||
"Ilshofen": {"location": "114"}
|
||||
}
|
||||
|
||||
API_URL = "http://exchange.cmcitymedia.de/landkreis-schwaebisch-hallt3/wasteCalendarExport.php?location="
|
||||
HEADERS = {"user-agent": "Mozilla/5.0 (xxxx Windows NT 10.0; Win64; x64)"}
|
||||
|
||||
|
||||
@@ -23,7 +22,7 @@ class Source:
|
||||
|
||||
def fetch(self):
|
||||
# get ics file
|
||||
full_url = URL + str(self._location)
|
||||
full_url = API_URL + str(self._location)
|
||||
r = requests.get(full_url, headers=HEADERS)
|
||||
r.raise_for_status()
|
||||
|
||||
|
||||
@@ -7,14 +7,15 @@ from bs4 import BeautifulSoup
|
||||
from urllib.parse import urlsplit, parse_qs
|
||||
import logging
|
||||
|
||||
TITLE = "manchester.gov.uk"
|
||||
TITLE = "Manchester City Council"
|
||||
DESCRIPTION = "Source for bin collection services for Manchester City Council, UK."
|
||||
URL = "https://www.manchester.gov.uk/bincollections/"
|
||||
URL = "https://www.manchester.gov.uk"
|
||||
TEST_CASES = {
|
||||
"domestic": {'uprn': '000077065560'},
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
API_URL = "https://www.manchester.gov.uk/bincollections/"
|
||||
ICON_MAP = {
|
||||
"Black / Grey Bin": "mdi:trash-can",
|
||||
"Blue Bin": "mdi:recycle",
|
||||
"Brown Bin": "mdi:glass-fragile",
|
||||
@@ -39,7 +40,7 @@ class Source:
|
||||
entries = []
|
||||
|
||||
r = requests.post(
|
||||
URL,
|
||||
API_URL,
|
||||
data={
|
||||
"mcc_bin_dates_uprn": self._uprn,
|
||||
"mcc_bin_dates_submit": "Go"
|
||||
@@ -64,7 +65,7 @@ class Source:
|
||||
Collection(
|
||||
date=date,
|
||||
t=collection_type,
|
||||
icon=ICONS[collection_type],
|
||||
icon=ICON_MAP[collection_type],
|
||||
)
|
||||
)
|
||||
except ValueError:
|
||||
|
||||
@@ -8,7 +8,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Melton City Council"
|
||||
DESCRIPTION = "Source for Melton City Council rubbish collection."
|
||||
URL = "https://www.melton.vic.gov.au/My-Area"
|
||||
URL = "https://www.melton.vic.gov.au"
|
||||
TEST_CASES = {
|
||||
"Tuesday A": {"street_address": "23 PILBARA AVENUE BURNSIDE 3023"},
|
||||
"Tuesday B": {"street_address": "29 COROWA CRESCENT BURNSIDE 3023"},
|
||||
|
||||
@@ -5,21 +5,9 @@ import time
|
||||
from datetime import datetime
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = 'middlesbrough.gov.uk'
|
||||
DESCRIPTION = (
|
||||
'Source for waste collection services for Middlesbrough Council'
|
||||
)
|
||||
URL = 'https://www.middlesbrough.gov.uk/bin-collection-dates'
|
||||
|
||||
|
||||
HEADERS = {
|
||||
"user-agent": "Mozilla/5.0",
|
||||
}
|
||||
|
||||
COOKIES = {
|
||||
|
||||
}
|
||||
|
||||
TITLE = 'Middlesbrough Council'
|
||||
DESCRIPTION = 'Source for waste collection services for Middlesbrough Council'
|
||||
URL = 'https://www.middlesbrough.gov.uk'
|
||||
TEST_CASES = {
|
||||
"Tollesby Road - number" : {"uprn": 100110140843},
|
||||
"Tollesby Road - string" : {"uprn": "100110140843"},
|
||||
@@ -33,6 +21,13 @@ API_URLS = {
|
||||
'schedule': 'https://my.middlesbrough.gov.uk/apibroker/runLookup?id=5d78f40439054&repeat_against=&noRetry=true&getOnlyTokens=undefined&log_id=&app_name=AF-Renderer::Self&'
|
||||
}
|
||||
|
||||
HEADERS = {
|
||||
"user-agent": "Mozilla/5.0",
|
||||
}
|
||||
|
||||
COOKIES = {
|
||||
}
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
class Source:
|
||||
|
||||
@@ -33,15 +33,15 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
# those bins, only for the so called "Fyrfack" bins (meaning four slots).
|
||||
#
|
||||
|
||||
TITLE = "Ronneby Miljöteknik Sophämntning"
|
||||
TITLE = "Ronneby Miljöteknik"
|
||||
DESCRIPTION = "Source for Ronneby Miljöteknik waste collection."
|
||||
URL = (
|
||||
"http://www.fyrfackronneby.se/hamtningskalender/"
|
||||
)
|
||||
URL = "http://www.fyrfackronneby.se"
|
||||
TEST_CASES = {
|
||||
"Home": {"street_address": "Hjortsbergavägen 16, Johannishus"}
|
||||
}
|
||||
|
||||
API_URL = "http://www.fyrfackronneby.se/hamtningskalender/"
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(self, street_address):
|
||||
|
||||
@@ -9,7 +9,7 @@ from pprint import pprint
|
||||
|
||||
TITLE = "Min Renovasjon"
|
||||
DESCRIPTION = "Source for Norkart Komtek MinRenovasjon (Norway)."
|
||||
URL = "https://www.norkart.no/komtek/renovasjon/"
|
||||
URL = "https://www.norkart.no"
|
||||
|
||||
# **street_code:** \
|
||||
# **county_id:** \
|
||||
@@ -29,8 +29,28 @@ TEST_CASES = {
|
||||
}
|
||||
}
|
||||
|
||||
BASE_URL = "https://komteksky.norkart.no/komtek.renovasjonwebapi/api/"
|
||||
API_URL = "https://komteksky.norkart.no/komtek.renovasjonwebapi/api/"
|
||||
APP_KEY = "AE13DEEC-804F-4615-A74E-B4FAC11F0A30"
|
||||
ICON_MAP = {
|
||||
"": "mdi:trash-can",
|
||||
"brush": "mdi:trash-can",
|
||||
"elektriskogelektronisk": "mdi:chip",
|
||||
"farligavfall": "mdi:trash-can",
|
||||
"glassogmetallemballasje": "mdi:trash-can",
|
||||
"hageavfall": "mdi:leaf",
|
||||
"klaerogsko": "mdi:hanger",
|
||||
"matavfall": "mdi:trash-can",
|
||||
"matrestavfall": "mdi:trash-can",
|
||||
"matrestavfallplast": "mdi:trash-can",
|
||||
"metall": "mdi:trash-can",
|
||||
"papir": "mdi:newspaper-variant-multiple",
|
||||
"pappogkartong": "mdi:archive",
|
||||
"plastemballasje": "mdi:trash-can",
|
||||
"restavfall": "mdi:trash-can",
|
||||
"drikkekartong": "mdi:newspaper-variant-multiple",
|
||||
"papppapirdrikkekartong": "mdi:newspaper-variant-multiple",
|
||||
"trevirke": "mdi:trash-can",
|
||||
}
|
||||
|
||||
class Source:
|
||||
def __init__(self, street_name, house_number, street_code, county_id):
|
||||
@@ -38,28 +58,6 @@ class Source:
|
||||
self._house_number = house_number
|
||||
self._street_code = street_code
|
||||
self._county_id = county_id
|
||||
self._icon_map = {
|
||||
"": "mdi:trash-can",
|
||||
"brush": "mdi:trash-can",
|
||||
"elektriskogelektronisk": "mdi:chip",
|
||||
"farligavfall": "mdi:trash-can",
|
||||
"glassogmetallemballasje": "mdi:trash-can",
|
||||
"hageavfall": "mdi:leaf",
|
||||
"klaerogsko": "mdi:hanger",
|
||||
"matavfall": "mdi:trash-can",
|
||||
"matrestavfall": "mdi:trash-can",
|
||||
"matrestavfallplast": "mdi:trash-can",
|
||||
"metall": "mdi:trash-can",
|
||||
"papir": "mdi:newspaper-variant-multiple",
|
||||
"pappogkartong": "mdi:archive",
|
||||
"plastemballasje": "mdi:trash-can",
|
||||
"restavfall": "mdi:trash-can",
|
||||
"drikkekartong": "mdi:newspaper-variant-multiple",
|
||||
"papppapirdrikkekartong": "mdi:newspaper-variant-multiple",
|
||||
"trevirke": "mdi:trash-can"
|
||||
|
||||
|
||||
}
|
||||
|
||||
def fetch(self):
|
||||
headers = {
|
||||
@@ -69,15 +67,13 @@ class Source:
|
||||
}
|
||||
args = {}
|
||||
|
||||
r = requests.get(BASE_URL + 'fraksjoner', params = args, headers = headers)
|
||||
r = requests.get(API_URL + 'fraksjoner', params = args, headers = headers)
|
||||
|
||||
type = {}
|
||||
for f in json.loads(r.content):
|
||||
# pprint(f)
|
||||
icon = "mdi:trash-can"
|
||||
icon_name = re.sub(r"^.*?/(\w+)\.\w{3,4}$", "\\1", f['Ikon'])
|
||||
if icon_name in self._icon_map:
|
||||
icon = self._icon_map[icon_name]
|
||||
icon = ICON_MAP.get(icon_name, "mdi:trash-can")
|
||||
type[f['Id']] = {
|
||||
'name': f['Navn'],
|
||||
'image': f['Ikon'],
|
||||
@@ -88,10 +84,9 @@ class Source:
|
||||
'gatenavn': self._street_name,
|
||||
'husnr': self._house_number,
|
||||
'gatekode': self._street_code,
|
||||
|
||||
}
|
||||
|
||||
r = requests.get(BASE_URL + 'tommekalender', params = args, headers = headers)
|
||||
r = requests.get(API_URL + 'tommekalender', params = args, headers = headers)
|
||||
|
||||
entries = []
|
||||
for f in json.loads(r.content):
|
||||
|
||||
@@ -8,7 +8,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Macedon Ranges Shire Council"
|
||||
DESCRIPTION = "Source for Macedon Ranges Shire Council rubbish collection."
|
||||
URL = "https://www.mrsc.vic.gov.au/Live-Work/Bins-Rubbish-Recycling/Bins-and-collection-days/Bin-collection-days"
|
||||
URL = "https://www.mrsc.vic.gov.au"
|
||||
TEST_CASES = {
|
||||
"Macedon IGA": {"street_address": "20 Victoria Street, Macedon"},
|
||||
"ALDI Gisborne": {"street_address": "45 Aitken Street, Gisborne"},
|
||||
|
||||
@@ -14,26 +14,26 @@ urllib3.disable_warnings()
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
TITLE = "newcastle.gov.uk"
|
||||
DESCRIPTION = (
|
||||
"""Source for waste collection services for Newcastle City Council"""
|
||||
)
|
||||
URL = "https://community.newcastle.gov.uk/my-neighbourhood/ajax/getBinsNew.php"
|
||||
REGEX = "<strong>(Green|Blue|Brown) [bB]in \\((Domestic|Recycling|Garden)( Waste)?\\) details: <\\/strong><br\\/>" \
|
||||
"collection day : [a-zA-Z]*day<br\\/>" \
|
||||
"Next collection : ([0-9]{2}-[A-Za-z]+-[0-9]{4})"
|
||||
ICONS = {
|
||||
"DOMESTIC": "mdi:trash-can",
|
||||
"RECYCLING": "mdi:recycle",
|
||||
"GARDEN": "mdi:leaf",
|
||||
}
|
||||
|
||||
TITLE = "Newcastle City Council"
|
||||
DESCRIPTION = "Source for waste collection services for Newcastle City Council"
|
||||
URL = "https://community.newcastle.gov.uk"
|
||||
TEST_CASES = {
|
||||
"Test_001": {"uprn": "004510053797"},
|
||||
"Test_002": {"uprn": 4510053797}
|
||||
}
|
||||
|
||||
|
||||
API_URL = "https://community.newcastle.gov.uk/my-neighbourhood/ajax/getBinsNew.php"
|
||||
REGEX = "<strong>(Green|Blue|Brown) [bB]in \\((Domestic|Recycling|Garden)( Waste)?\\) details: <\\/strong><br\\/>" \
|
||||
"collection day : [a-zA-Z]*day<br\\/>" \
|
||||
"Next collection : ([0-9]{2}-[A-Za-z]+-[0-9]{4})"
|
||||
ICON_MAP = {
|
||||
"DOMESTIC": "mdi:trash-can",
|
||||
"RECYCLING": "mdi:recycle",
|
||||
"GARDEN": "mdi:leaf",
|
||||
}
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(self, uprn=None):
|
||||
self._uprn = str(uprn).zfill(12)
|
||||
@@ -56,7 +56,7 @@ class Source:
|
||||
Collection(
|
||||
date=datetime.strptime(collection_date, '%d-%b-%Y').date(),
|
||||
t=collection_type,
|
||||
icon=ICONS.get(collection_type.upper()),
|
||||
icon=ICON_MAP.get(collection_type.upper()),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import time
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "nottinghamcity.gov.uk"
|
||||
TITLE = "Nottingham City Council"
|
||||
DESCRIPTION = "Source for nottinghamcity.gov.uk services for the city of Nottingham, UK."
|
||||
URL = "https://nottinghamcity.gov.uk"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -5,7 +5,7 @@ import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "North Somerset.gov.uk"
|
||||
TITLE = "North Somerset Council"
|
||||
DESCRIPTION = "Source for n-somerset.gov.uk services for North Somerset, UK."
|
||||
URL = "n-somerset.gov.uk"
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from pprint import pprint
|
||||
|
||||
TITLE = "Oslo Kommune"
|
||||
DESCRIPTION = "Oslo Kommune (Norway)."
|
||||
URL = "https://www.oslo.kommune.no/avfall-og-gjenvinning/nar-hentes-avfallet/"
|
||||
URL = "https://www.oslo.kommune.no"
|
||||
|
||||
# **street_code:** \
|
||||
# **county_id:** \
|
||||
@@ -29,7 +29,12 @@ TEST_CASES = {
|
||||
}
|
||||
}
|
||||
|
||||
BASE_URL = "https://www.oslo.kommune.no/xmlhttprequest.php"
|
||||
API_URL = "https://www.oslo.kommune.no/xmlhttprequest.php"
|
||||
ICON_MAP = {
|
||||
"": "mdi:trash-can",
|
||||
"restavfall": "mdi:trash-can",
|
||||
"papir": "mdi:newspaper-variant-multiple"
|
||||
}
|
||||
|
||||
class Source:
|
||||
def __init__(self, street_name, house_number, house_letter, street_id):
|
||||
@@ -37,11 +42,6 @@ class Source:
|
||||
self._house_number = house_number
|
||||
self._house_letter = house_letter
|
||||
self._street_id = street_id
|
||||
self._icon_map = {
|
||||
"": "mdi:trash-can",
|
||||
"restavfall": "mdi:trash-can",
|
||||
"papir": "mdi:newspaper-variant-multiple"
|
||||
}
|
||||
|
||||
def fetch(self):
|
||||
headers = {
|
||||
@@ -56,7 +56,7 @@ class Source:
|
||||
'street_id': self._street_id,
|
||||
}
|
||||
|
||||
r = requests.get(BASE_URL, params = args, headers = headers)
|
||||
r = requests.get(API_URL, params = args, headers = headers)
|
||||
|
||||
entries = []
|
||||
res = json.loads(r.content)['data']['result'][0]['HentePunkts']
|
||||
@@ -70,7 +70,7 @@ class Source:
|
||||
tjeneste['TommeDato'], "%d.%m.%Y"
|
||||
).date(),
|
||||
t = tekst,
|
||||
icon = self._icon_map[tekst.lower()] or "mdi:trash-can"
|
||||
icon = ICON_MAP.get(tekst.lower(), "mdi:trash-can")
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ import datetime
|
||||
import requests
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "Peterborough.gov.uk"
|
||||
TITLE = "Peterborough City Council"
|
||||
DESCRIPTION = (
|
||||
"Source for peterborough.gov.uk services for Peterborough"
|
||||
)
|
||||
URL = "peterborough.gov.uk"
|
||||
URL = "https://peterborough.gov.uk"
|
||||
TEST_CASES = {
|
||||
"houseNumber": {"post_code": "PE57AX", "number": 1},
|
||||
"houseName": {"post_code": "PE57AX", "name": "CASTOR HOUSE"},
|
||||
@@ -20,7 +20,7 @@ API_URLS = {
|
||||
"collection": "https://www.peterborough.gov.uk/api/jobs/{start}/{end}/{uprn}",
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"Empty Bin 240L Black": "mdi:trash-can",
|
||||
"Empty Bin 240L Green": "mdi:recycle",
|
||||
"Empty Bin 240L Brown": "mdi:leaf",
|
||||
@@ -74,7 +74,7 @@ class Source:
|
||||
collection["nextDate"], "%Y-%m-%dT%H:%M:%S"
|
||||
).date(),
|
||||
t=collection["jobDescription"],
|
||||
icon=ICONS.get(collection["jobDescription"]),
|
||||
icon=ICON_MAP.get(collection["jobDescription"]),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ from urllib.parse import quote
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "PGH.ST"
|
||||
TITLE = "City of Pittsburgh"
|
||||
DESCRIPTION = "Source for PGH.ST services for the city of Pittsburgh, PA, USA."
|
||||
URL = "http://www.pgh.st"
|
||||
TEST_CASES = {}
|
||||
URL = "https://www.pgh.st"
|
||||
COUNTRY = "us"
|
||||
TEST_CASES = {
|
||||
"Pittsburgh, Negley": {
|
||||
"house_number": 800,
|
||||
|
||||
@@ -7,6 +7,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
TITLE = "RecycleSmart"
|
||||
DESCRIPTION = "Source for RecycleSmart collection."
|
||||
URL = "https://www.recyclesmart.com/"
|
||||
COUNTRY = "au"
|
||||
TEST_CASES = {
|
||||
"pickup": {
|
||||
"email": "!secret recyclesmart_email",
|
||||
|
||||
@@ -2,15 +2,14 @@ import requests
|
||||
from waste_collection_schedule import Collection
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "RegioEntsorgung"
|
||||
TITLE = "RegioEntsorgung Städteregion Aachen"
|
||||
DESCRIPTION = "RegioEntsorgung Städteregion Aachen"
|
||||
URL = "https://regioentsorgung.de/service/abfallkalender/"
|
||||
|
||||
URL = "https://regioentsorgung.de"
|
||||
TEST_CASES = {
|
||||
"Merzbrück": {"city": "Würselen", "street": "Merzbrück", "house_number": 200 },
|
||||
}
|
||||
|
||||
BASE_URL = "https://tonnen.regioentsorgung.de/WasteManagementRegioentsorgung/WasteManagementServlet"
|
||||
API_URL = "https://tonnen.regioentsorgung.de/WasteManagementRegioentsorgung/WasteManagementServlet"
|
||||
|
||||
HEADERS = {
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64)",
|
||||
@@ -31,7 +30,7 @@ class Source:
|
||||
payload = {
|
||||
'SubmitAction': 'wasteDisposalServices',
|
||||
}
|
||||
r = session.get(BASE_URL, headers=HEADERS, params=payload)
|
||||
r = session.get(API_URL, headers=HEADERS, params=payload)
|
||||
r.raise_for_status()
|
||||
|
||||
payload = {
|
||||
@@ -41,7 +40,7 @@ class Source:
|
||||
'Strasse': '',
|
||||
'Hausnummer': '',
|
||||
}
|
||||
r = session.post(BASE_URL, headers=HEADERS, data=payload)
|
||||
r = session.post(API_URL, headers=HEADERS, data=payload)
|
||||
r.raise_for_status()
|
||||
|
||||
payload = {
|
||||
@@ -51,7 +50,7 @@ class Source:
|
||||
'Strasse': self.street,
|
||||
'Hausnummer': '',
|
||||
}
|
||||
r = session.post(BASE_URL, headers=HEADERS, data=payload)
|
||||
r = session.post(API_URL, headers=HEADERS, data=payload)
|
||||
r.raise_for_status()
|
||||
|
||||
payload = {
|
||||
@@ -61,14 +60,14 @@ class Source:
|
||||
'Strasse': self.street,
|
||||
'Hausnummer': self.house_number,
|
||||
}
|
||||
r = session.post(BASE_URL, headers=HEADERS, data=payload)
|
||||
r = session.post(API_URL, headers=HEADERS, data=payload)
|
||||
r.raise_for_status()
|
||||
|
||||
payload = {
|
||||
'ApplicationName': 'com.athos.kd.regioentsorgung.AbfuhrTerminModel',
|
||||
'SubmitAction': 'forward',
|
||||
}
|
||||
r = session.post(BASE_URL, headers=HEADERS, data=payload)
|
||||
r = session.post(API_URL, headers=HEADERS, data=payload)
|
||||
r.raise_for_status()
|
||||
|
||||
payload = {
|
||||
@@ -86,7 +85,7 @@ class Source:
|
||||
'ICalZeit': '06:00 Uhr',
|
||||
'SubmitAction': 'filedownload_ICAL',
|
||||
}
|
||||
r = session.post(BASE_URL, headers=HEADERS, data=payload)
|
||||
r = session.post(API_URL, headers=HEADERS, data=payload)
|
||||
r.raise_for_status()
|
||||
|
||||
# Parse ics file
|
||||
|
||||
@@ -7,6 +7,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
TITLE = "Republic Services"
|
||||
DESCRIPTION = "Source for Republic Services Collection."
|
||||
URL = "https://www.republicservices.com"
|
||||
COUNTRY = "us"
|
||||
TEST_CASES = {
|
||||
"Scott Country Clerk": {"street_address": "101 E Main St, Georgetown, KY 40324"},
|
||||
"Branch County Clerk": {"street_address": "31 Division St. Coldwater, MI 49036"}
|
||||
|
||||
@@ -4,7 +4,7 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "RH Entsorgung"
|
||||
TITLE = "Rhein-Hunsrück Entsorgung (RHE)"
|
||||
DESCRIPTION = "Source for RHE (Rhein Hunsrück Entsorgung)."
|
||||
URL = "https://www.rh-entsorgung.de"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -3,16 +3,16 @@ from datetime import datetime
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Richmondshire (North Yorkshire)"
|
||||
TITLE = "Richmondshire District Council"
|
||||
DESCRIPTION = "To find your UPRN, visit the Richmondshire page and use the address search. Right-click your entry in the house dropdown, choose Inspect, and copy the UPRN from the value"
|
||||
URL = "https://www.richmondshire.gov.uk/collectionCalendar"
|
||||
URL = "https://www.richmondshire.gov.uk"
|
||||
TEST_CASES = {
|
||||
"test1": {"uprn": 200001767082},
|
||||
"test2": {"uprn": 200001767078},
|
||||
"test3": {"uprn": 200001767079},
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"240L GREY RUBBISH BIN": "mdi:trash-can",
|
||||
"55L RECYCLING BOX": "mdi:recycle",
|
||||
"140L GARDEN BIN": "mdi:leaf",
|
||||
@@ -38,7 +38,7 @@ class Source:
|
||||
Collection(
|
||||
date=datetime.strptime(id["start"], "%Y-%m-%dT%H:%M:%S").date(),
|
||||
t=id["title"],
|
||||
icon=ICONS.get(id["title"]),
|
||||
icon=ICON_MAP.get(id["title"]),
|
||||
)
|
||||
)
|
||||
return entries
|
||||
|
||||
@@ -2,9 +2,8 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "rushmoor.gov.uk"
|
||||
TITLE = "Rushmoor Borough Council"
|
||||
DESCRIPTION = "Source for rushmoor.gov.uk services for Rushmoor, UK."
|
||||
# Find the UPRN of your address using https://www.findmyaddress.co.uk/search
|
||||
URL = "https://rushmoor.gov.uk"
|
||||
TEST_CASES = {
|
||||
"GU14": {"uprn": "100060551749"},
|
||||
|
||||
@@ -5,9 +5,9 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "Abfall SBAZV"
|
||||
TITLE = "Südbrandenburgischer Abfallzweckverband"
|
||||
DESCRIPTION = "SBAZV Brandenburg, Deutschland"
|
||||
URL = "https://www.sbazv.de/entsorgungstermine/klein.ics"
|
||||
URL = "https://www.sbazv.de"
|
||||
TEST_CASES = {
|
||||
"Wildau": {
|
||||
"city": "wildau",
|
||||
@@ -16,21 +16,23 @@ TEST_CASES = {
|
||||
}
|
||||
}
|
||||
|
||||
ICON_MAP = {
|
||||
"Restmülltonnen": "mdi:trash-can",
|
||||
"Laubsäcke" : "mdi:leaf",
|
||||
"Gelbe Säcke" : "mdi:sack",
|
||||
"Papiertonnen" : "mdi:package-variant",
|
||||
"Weihnachtsbäume": "mdi:pine-tree",
|
||||
}
|
||||
|
||||
# _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(self, city, district, street=None):
|
||||
self._city = city
|
||||
self._district = district
|
||||
self._street = street
|
||||
self._ics = ICS()
|
||||
self._iconMap = {
|
||||
"Restmülltonnen": "mdi:trash-can",
|
||||
"Laubsäcke" : "mdi:leaf",
|
||||
"Gelbe Säcke" : "mdi:sack",
|
||||
"Papiertonnen" : "mdi:package-variant",
|
||||
"Weihnachtsbäume": "mdi:pine-tree",
|
||||
}
|
||||
|
||||
def fetch(self):
|
||||
now = datetime.now()
|
||||
@@ -68,6 +70,6 @@ class Source:
|
||||
waste_type = d[1].strip()
|
||||
next_pickup_date = d[0]
|
||||
|
||||
entries.append(Collection(date=next_pickup_date, t=waste_type, icon=self._iconMap.get(waste_type,"mdi:trash-can")))
|
||||
entries.append(Collection(date=next_pickup_date, t=waste_type, icon=ICON_MAP.get(waste_type,"mdi:trash-can")))
|
||||
|
||||
return entries
|
||||
|
||||
@@ -4,20 +4,21 @@ from datetime import datetime
|
||||
import requests
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "Scambs.gov.uk"
|
||||
TITLE = "South Cambridgeshire District Council"
|
||||
DESCRIPTION = (
|
||||
"Source for scambs.gov.uk services for South Cambridgeshire District Council"
|
||||
)
|
||||
URL = "scambs.gov.uk"
|
||||
URL = "https://scambs.gov.uk"
|
||||
TEST_CASES = {
|
||||
"houseNumber": {"post_code": "CB236GZ", "number": 53},
|
||||
"houseName": {"post_code": "CB225HT", "number": "Rectory Farm Cottage"},
|
||||
}
|
||||
|
||||
API_URLS = {
|
||||
"address_search": "https://servicelayer3c.azure-api.net/wastecalendar/address/search/",
|
||||
"collection": "https://servicelayer3c.azure-api.net/wastecalendar/collection/search/{}/",
|
||||
}
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"DOMESTIC": "mdi:trash-can",
|
||||
"RECYCLE": "mdi:recycle",
|
||||
"ORGANIC": "mdi:leaf",
|
||||
@@ -68,7 +69,7 @@ class Source:
|
||||
round_type, round_type.title()
|
||||
), # returns concise values: Black Bin, Blue Bin, Green Bin
|
||||
# t = round_type.title(), # returns standard Scambs values: Black Bin Collection, Blue Bin Collection, Green Bin Collection
|
||||
icon=ICONS.get(round_type),
|
||||
icon=ICON_MAP.get(round_type),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Seattle Public Utilities"
|
||||
DESCRIPTION = "Source for Seattle Public Utilities waste collection."
|
||||
URL = "https://myutilities.seattle.gov/eportal/#/accountlookup/calendar"
|
||||
URL = "https://myutilities.seattle.gov"
|
||||
COUNTRY = "us"
|
||||
TEST_CASES = {
|
||||
"City Hall": {"street_address": "600 4th Ave"},
|
||||
"Ballard Builders": {"street_address": "7022 12th Ave NW"},
|
||||
|
||||
@@ -6,7 +6,7 @@ import re
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Sector 27"
|
||||
TITLE = "Sector 27 - Datteln, Marl, Oer-Erkenschwick"
|
||||
DESCRIPTION = "Source for Muellkalender in Kreis RE."
|
||||
URL = "https://muellkalender.sector27.de"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -4,20 +4,9 @@ from dateutil import parser
|
||||
import logging
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "Sheffield.gov.uk"
|
||||
|
||||
DESCRIPTION = (
|
||||
"Source for waste collection services from Sheffield City Council (SCC)"
|
||||
)
|
||||
|
||||
# Base URL for waste collection services
|
||||
URL = "https://wasteservices.sheffield.gov.uk/"
|
||||
|
||||
# Headers to mimic the browser
|
||||
HEADERS = {
|
||||
"user-agent": "Mozilla/5.0",
|
||||
}
|
||||
|
||||
TITLE = "Sheffield City Council"
|
||||
DESCRIPTION = "Source for waste collection services from Sheffield City Council (SCC)"
|
||||
URL = "https://sheffield.gov.uk/"
|
||||
TEST_CASES = {
|
||||
# These are random addresses around Sheffield
|
||||
# If your property is listed here and you don't want it, please raise an issue and I'll amend
|
||||
@@ -26,8 +15,16 @@ TEST_CASES = {
|
||||
"test003" : {"uprn": "100050920796"},
|
||||
}
|
||||
|
||||
|
||||
API_URL = "https://wasteservices.sheffield.gov.uk/"
|
||||
|
||||
# Headers to mimic the browser
|
||||
HEADERS = {
|
||||
"user-agent": "Mozilla/5.0",
|
||||
}
|
||||
|
||||
# Icons for the different bin types
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"BLACK": "mdi:delete-empty", # General Waste
|
||||
"BROWN": "mdi:glass-fragile", # Glass, Tins, Cans & Plastics
|
||||
"BLUE": "mdi:newspaper", # Paper & Cardboard
|
||||
@@ -44,7 +41,7 @@ class Source:
|
||||
if self._uprn:
|
||||
# Get the page containing bin details
|
||||
# /calendar gives further future informaion over just the "Services" page
|
||||
req = urllib.request.Request(f"{URL}/property/{self._uprn}/calendar",headers=HEADERS)
|
||||
req = urllib.request.Request(f"{API_URL}/property/{self._uprn}/calendar",headers=HEADERS)
|
||||
with urllib.request.urlopen(req) as response:
|
||||
html_doc = response.read()
|
||||
|
||||
@@ -65,7 +62,7 @@ class Source:
|
||||
Collection(
|
||||
date = collection_date,
|
||||
t = collection_type,
|
||||
icon = ICONS.get(collection_type.replace(" Bin","").upper()),
|
||||
icon = ICON_MAP.get(collection_type.replace(" Bin","").upper()),
|
||||
)
|
||||
)
|
||||
except ValueError:
|
||||
|
||||
@@ -9,9 +9,8 @@ import requests
|
||||
from bs4 import BeautifulSoup as soup
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "South Norfolk and Broadland Council UK"
|
||||
TITLE = "South Norfolk and Broadland Council"
|
||||
DESCRIPTION = "Source for southnorfolkandbroadland.gov.uk services for South Norfolk and Broadland, UK"
|
||||
|
||||
URL = "https://area.southnorfolkandbroadland.gov.uk/"
|
||||
TEST_CASES = {
|
||||
"Random address": {
|
||||
@@ -42,7 +41,7 @@ TEST_CASES = {
|
||||
}
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"Rubbish": "mdi:trash-can",
|
||||
"Recycling": "mdi:recycle",
|
||||
"Garden (if applicable)": "mdi:leaf"
|
||||
@@ -75,7 +74,7 @@ class Source:
|
||||
Collection(
|
||||
parse_date(tuple(bin_category.children)[3].strip()),
|
||||
tuple(bin_category.children)[1].text.strip(),
|
||||
icon=ICONS.get(tuple(bin_category.children)[1].text.strip())
|
||||
icon=ICON_MAP.get(tuple(bin_category.children)[1].text.strip())
|
||||
)
|
||||
for bin_category
|
||||
in bin_categories
|
||||
|
||||
@@ -3,9 +3,9 @@ import requests
|
||||
from datetime import datetime
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "SRV återvinning AB Sweden"
|
||||
TITLE = "SRV Återvinning"
|
||||
DESCRIPTION = "Source for SRV återvinning AB, Sweden"
|
||||
URL = "https://www.srvatervinning.se/sophamtning/privat/hamtinformation-och-driftstorningar"
|
||||
URL = "https://www.srvatervinning.se"
|
||||
TEST_CASES = {
|
||||
"Skansvägen" : {"address":"Skansvägen" },
|
||||
"TEST2" : {"address":"tun" }
|
||||
|
||||
@@ -4,9 +4,9 @@ from datetime import datetime
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "SSAM Sophämntning"
|
||||
TITLE = "SSAM"
|
||||
DESCRIPTION = "Source for SSAM waste collection."
|
||||
URL = "https://edpfuture.ssam.se/FutureWeb/SimpleWastePickup/GetWastePickupSchedule"
|
||||
URL = "https://ssam.se"
|
||||
TEST_CASES = {
|
||||
"Home": {"street_address": "Asteroidvägen 1, Växjö"},
|
||||
"Bostadsrätt": {"street_address": "Långa Gatan 29 -81, Växjö"},
|
||||
|
||||
@@ -6,17 +6,18 @@ from waste_collection_schedule.service.ICS import ICS
|
||||
TITLE = "Stadt Willich"
|
||||
DESCRIPTION = "Source for Stadt Willich waste collection."
|
||||
URL = "https://www.stadt-willich.de"
|
||||
ICONS = {
|
||||
TEST_CASES = {
|
||||
"Altufer": {"street": "Altufer"},
|
||||
"Zum Schickerhof": {"street": "Zum Schickerhof"},
|
||||
}
|
||||
|
||||
ICON_MAP = {
|
||||
"Graue Tonne": "mdi:trash-can",
|
||||
"Blaue Tonne": "mdi:newspaper-variant-multiple",
|
||||
"Gelbe Tonne": "mdi:recycle",
|
||||
"Bio Tonne": "mdi:bio",
|
||||
"Grünbündel": "mdi:tree",
|
||||
}
|
||||
TEST_CASES = {
|
||||
"Altufer": {"street": "Altufer"},
|
||||
"Zum Schickerhof": {"street": "Zum Schickerhof"},
|
||||
}
|
||||
|
||||
|
||||
class Source:
|
||||
@@ -59,7 +60,7 @@ class Source:
|
||||
|
||||
entries = []
|
||||
for d in dates:
|
||||
icon = ICONS.get(d[1], "mdi:trash-can")
|
||||
icon = ICON_MAP.get(d[1], "mdi:trash-can")
|
||||
entries.append(Collection(
|
||||
date=d[0],
|
||||
t=d[1],
|
||||
|
||||
@@ -6,7 +6,7 @@ from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "Stadtreinigung Dresden"
|
||||
DESCRIPTION = "Source for Stadtreinigung Dresden waste collection."
|
||||
URL = "https://www.dresden.de/apps_ext/AbfallApp/wastebins?0"
|
||||
URL = "https://www.dresden.de"
|
||||
TEST_CASES = {
|
||||
"Neumarkt 6": {"standort": 80542},
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "StadtService Brühl"
|
||||
DESCRIPTION = "Source für Abfallkalender StadtService Brühl"
|
||||
URL = "https://services.stadtservice-bruehl.de/abfallkalender/"
|
||||
URL = "https://stadtservice-bruehl.de"
|
||||
TEST_CASES = {
|
||||
"TEST1" : {"strasse":"Badorfer Straße","hnr":"1" }
|
||||
}
|
||||
|
||||
@@ -4,10 +4,9 @@ import datetime
|
||||
from waste_collection_schedule import Collection
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "Städteservice"
|
||||
TITLE = "Städteservice Raunheim Rüsselsheim"
|
||||
DESCRIPTION = "Städteservice Raunheim Rüsselsheim"
|
||||
URL = "https://www.staedteservice.de"
|
||||
|
||||
TEST_CASES = {
|
||||
"Rüsselsheim": {
|
||||
"city": "Rüsselsheim",
|
||||
@@ -19,7 +18,7 @@ TEST_CASES = {
|
||||
},
|
||||
}
|
||||
|
||||
BASE_URL = "https://www.staedteservice.de/abfallkalender"
|
||||
API_URL = "https://www.staedteservice.de/abfallkalender"
|
||||
|
||||
CITY_CODE_MAP = {
|
||||
"Rüsselsheim": 1,
|
||||
@@ -64,7 +63,7 @@ class Source:
|
||||
|
||||
def get_calendar_from_site(self, session: requests.Session, year: int) -> str:
|
||||
# example format: https://www.staedteservice.de/abfallkalender_1_477_2023.ics
|
||||
URL = f"{BASE_URL}_{self.city_code}_{self.street_number}_{str(year)}.ics"
|
||||
URL = f"{API_URL}_{self.city_code}_{self.street_number}_{str(year)}.ics"
|
||||
|
||||
r = session.get(URL)
|
||||
r.raise_for_status()
|
||||
|
||||
@@ -12,11 +12,12 @@ TEST_CASES = {
|
||||
"Wansbeck Close schedule": {"road": "Wansbeck Close", "postcode": "SG1 6AA"},
|
||||
"Chepstow Close schedule": {"road": "Chepstow Close", "postcode": "SG1 5TT"},
|
||||
}
|
||||
|
||||
SEARCH_URLS = {
|
||||
"round_search": "https://services.stevenage.gov.uk/~?a=find&v=1&p=P1&c=P1_C33_&act=P1_A43_",
|
||||
"collection_search": "https://services.stevenage.gov.uk/~?a=find&v=1&p=P1&c=P1_C37_&act=P1_A64_",
|
||||
}
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"REFUSE": "mdi:trash-can",
|
||||
"RECYCLING": "mdi:recycle",
|
||||
}
|
||||
@@ -83,7 +84,7 @@ class Source:
|
||||
Collection(
|
||||
date=datetime.strptime(collection[1], "%d/%m/%Y").date(),
|
||||
t="Recycling",
|
||||
icon=ICONS["RECYCLING"],
|
||||
icon=ICON_MAP["RECYCLING"],
|
||||
)
|
||||
)
|
||||
elif collection[2] == "Refuse collection":
|
||||
@@ -91,7 +92,7 @@ class Source:
|
||||
Collection(
|
||||
date=datetime.strptime(collection[1], "%d/%m/%Y").date(),
|
||||
t="Refuse",
|
||||
icon=ICONS["REFUSE"],
|
||||
icon=ICON_MAP["REFUSE"],
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Stonnington City Council"
|
||||
DESCRIPTION = "Source for Stonnington City Council rubbish collection."
|
||||
URL = "https://www.stonnington.vic.gov.au/Services/Waste-and-recycling"
|
||||
URL = "https://www.stonnington.vic.gov.au"
|
||||
TEST_CASES = {
|
||||
"The Jam Factory": {"street_address": "500 Chapel Street, South Yarra"},
|
||||
"Malvern Library": {"street_address": "1255 High Street, Malvern"},
|
||||
|
||||
@@ -6,7 +6,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Abfall Stuttgart"
|
||||
DESCRIPTION = "Source for waste collections for the city of Stuttgart, Germany."
|
||||
URL = "https://service.stuttgart.de/lhs-services/aws/"
|
||||
URL = "https://service.stuttgart.de"
|
||||
TEST_CASES = {"Im Steinengarten 7": {"street": "Im Steinengarten", "streetnr": 7}}
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Sysav Sophämntning"
|
||||
DESCRIPTION = "Source for Sysav waste collection."
|
||||
URL = "https://www.sysav.se/Privat/min-sophamtning/"
|
||||
URL = "https://www.sysav.se"
|
||||
TEST_CASES = {
|
||||
"Home": {"street_address": "Sommargatan 1, Svedala"},
|
||||
"Polisen": {"street_address": "Stationsplan 1, Svedala"},
|
||||
|
||||
@@ -4,9 +4,9 @@ from urllib.parse import quote as urlquote
|
||||
import requests
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "Tewkesbury Borough Council Waste and Recycling"
|
||||
TITLE = "Tewkesbury Borough Council"
|
||||
DESCRIPTION = "Home waste collection schedule for Tewkesbury Borough Council"
|
||||
URL = "https://www.tewkesbury.gov.uk/waste-and-recycling"
|
||||
URL = "https://www.tewkesbury.gov.uk"
|
||||
TEST_CASES = {
|
||||
"Council Office": {"postcode": "GL20 5TT"},
|
||||
"Council Office No Spaces": {"postcode": "GL205TT"},
|
||||
@@ -14,7 +14,7 @@ TEST_CASES = {
|
||||
|
||||
API_URL = "https://api-2.tewkesbury.gov.uk/general/rounds/%s/nextCollection"
|
||||
|
||||
ICONS = {
|
||||
ICON_MAP = {
|
||||
"Refuse": "mdi:trash-can",
|
||||
"Recycling": "mdi:recycle",
|
||||
"Garden": "mdi:leaf",
|
||||
@@ -47,7 +47,7 @@ class Source:
|
||||
date=datetime.strptime(
|
||||
schedule_entry["NextCollection"], "%Y-%m-%d").date(),
|
||||
t=schedule_entry["collectionType"],
|
||||
icon=ICONS.get(schedule_entry["collectionType"])
|
||||
icon=ICON_MAP.get(schedule_entry["collectionType"])
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import logging
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "The Hills Shire Council"
|
||||
TITLE = "The Hills Shire Council, Sydney"
|
||||
DESCRIPTION = "Source for Hills Shire Council, Sydney, Australia waste collection."
|
||||
URL = "https://www.thehills.nsw.gov.au/"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -6,17 +6,15 @@ from ..collection import Collection
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
TITLE = 'Toronto'
|
||||
DESCRIPTION = (
|
||||
'Source for Toronto waste collection'
|
||||
)
|
||||
TITLE = 'City of Toronto'
|
||||
DESCRIPTION = 'Source for Toronto waste collection'
|
||||
URL = 'https://www.toronto.ca'
|
||||
CSV_URL = 'https://www.toronto.ca/ext/swms/collection_calendar.csv'
|
||||
TEST_CASES = {
|
||||
"224 Wallace Ave": {"street_address": "224 Wallace Ave"},
|
||||
"324 Weston Rd": {"street_address": "324 Weston Rd"},
|
||||
}
|
||||
|
||||
CSV_URL = 'https://www.toronto.ca/ext/swms/collection_calendar.csv'
|
||||
PROPERTY_LOOKUP_URL = 'https://map.toronto.ca/cotgeocoder/rest/geocoder/suggest'
|
||||
SCHEDULE_LOOKUP_URL = 'https://map.toronto.ca/cotgeocoder/rest/geocoder/findAddressCandidates'
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@ from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "VA Syd Sophämntning"
|
||||
DESCRIPTION = "Source for VA Syd waste collection."
|
||||
URL = (
|
||||
"https://www.vasyd.se/Artiklar/Avfall-och-soptomning-privat/sopt%C3%B6mning-schema/"
|
||||
)
|
||||
URL = "https://www.vasyd.se"
|
||||
TEST_CASES = {
|
||||
"Home": {"street_address": "Industrigatan 13, Malmö"},
|
||||
"Polisen": {"street_address": "Drottninggatan 20, Malmö"},
|
||||
|
||||
@@ -9,8 +9,8 @@ TITLE = "Waipa District Council"
|
||||
DESCRIPTION = "Source for Waipa District Council. Finds both general and glass recycling dates."
|
||||
URL = "https://www.waipadc.govt.nz/"
|
||||
TEST_CASES = {
|
||||
"10 Queen Street": {"address": "10 Queen Street"} #Monday
|
||||
,"1 Acacia Avenue": {"address": "1 Acacia Avenue"}#Wednesday
|
||||
"10 Queen Street": {"address": "10 Queen Street"}, # Monday
|
||||
"1 Acacia Avenue": {"address": "1 Acacia Avenue"}, # Wednesday
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,18 +6,9 @@ from datetime import datetime
|
||||
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "walsall.gov.uk"
|
||||
|
||||
DESCRIPTION = (
|
||||
"Source for waste collection services from Walsall Council"
|
||||
)
|
||||
|
||||
URL = "https://cag.walsall.gov.uk"
|
||||
|
||||
HEADERS = {
|
||||
"user-agent": "Mozilla/5.0",
|
||||
}
|
||||
|
||||
TITLE = "Walsall Council"
|
||||
DESCRIPTION = "Source for waste collection services from Walsall Council"
|
||||
URL = "https://www.walsall.gov.uk/"
|
||||
TEST_CASES = {
|
||||
"test001" : {"uprn": "100071103746"},
|
||||
"test002" : {"uprn": 100071105627},
|
||||
@@ -25,11 +16,15 @@ TEST_CASES = {
|
||||
"test004" : {"uprn": 100071048794},
|
||||
}
|
||||
|
||||
ICONS = {
|
||||
API_URL = "https://cag.walsall.gov.uk"
|
||||
ICON_MAP = {
|
||||
"GREY": "mdi:trash-can",
|
||||
"GREEN": "mdi:recycle",
|
||||
"BROWN": "mdi:leaf",
|
||||
}
|
||||
HEADERS = {
|
||||
"user-agent": "Mozilla/5.0",
|
||||
}
|
||||
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@@ -55,7 +50,7 @@ class Source:
|
||||
if "roundname" in item["href"]:
|
||||
#get bin colour
|
||||
bincolour = item["href"].split("=")[-1].split("%")[0].upper()
|
||||
binURL = URL + item["href"]
|
||||
binURL = API_URL + item["href"]
|
||||
r = s.get(binURL, headers=HEADERS)
|
||||
responseContent = r.text
|
||||
soup = BeautifulSoup(responseContent, "html.parser")
|
||||
@@ -67,7 +62,7 @@ class Source:
|
||||
Collection(
|
||||
date = collection_date.date(),
|
||||
t = bincolour,
|
||||
icon = ICONS.get(bincolour),
|
||||
icon = ICON_MAP.get(bincolour),
|
||||
)
|
||||
)
|
||||
except ValueError:
|
||||
|
||||
@@ -4,9 +4,9 @@ from datetime import datetime
|
||||
import requests
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "Warszawa19115.pl"
|
||||
TITLE = "Warsaw"
|
||||
DESCRIPTION = "Source for Warsaw city garbage collection"
|
||||
URL = "https://warszawa19115.pl/harmonogramy-wywozu-odpadow"
|
||||
URL = "https://warszawa19115.pl"
|
||||
TEST_CASES = {
|
||||
"Street Name": {"street_address": "MARSZAŁKOWSKA 84/92, 00-514 Śródmieście"},
|
||||
"Geolocation ID": {"geolocation_id": "76802934"},
|
||||
|
||||
@@ -5,7 +5,7 @@ from html.parser import HTMLParser
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Wastenet"
|
||||
TITLE = "Gore, Invercargill & Southland"
|
||||
DESCRIPTION = "Source for Wastenet.org.nz."
|
||||
URL = "http://www.wastenet.org.nz"
|
||||
TEST_CASES = {
|
||||
|
||||
@@ -4,17 +4,16 @@ import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
TITLE = "Abfallkalender Wermelskirchen"
|
||||
TITLE = "Wermelskirchen"
|
||||
DESCRIPTION = "Source for Abfallabholung Wermelskirchen, Germany"
|
||||
URL = "https://www.wermelskirchen.de/rathaus/buergerservice/formulare-a-z/abfallkalender-online/"
|
||||
|
||||
URL = "https://www.wermelskirchen.de"
|
||||
TEST_CASES = {
|
||||
"Rathaus": {"street": "Telegrafenstraße", "house_number": "29"},
|
||||
"Krankenhaus": {"street": "Königstraße", "house_number": "100"},
|
||||
"Mehrzweckhalle": {"street": "An der Mehrzweckhalle", "house_number": "1"},
|
||||
}
|
||||
|
||||
INFOS = {
|
||||
ICON_MAP = {
|
||||
"Restabfall 2-woechentlich": {
|
||||
"icon": "mdi:trash-can",
|
||||
"image": "https://abfallkalender.citkomm.de/fileadmin/_processed_/1/b/csm_Restmuell_6b2b32c774.png",
|
||||
@@ -80,7 +79,7 @@ class Source:
|
||||
|
||||
entries = []
|
||||
for d in dates:
|
||||
info = INFOS.get(d[1], {"icon": "mdi:trash-can", "image": ""})
|
||||
info = ICON_MAP.get(d[1], {"icon": "mdi:trash-can", "image": ""})
|
||||
entries.append(
|
||||
Collection(d[0], d[1], picture=info["image"], icon=info["icon"])
|
||||
)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user