From a6ecb0c6142a490e9e2dbf705354045ead347cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20Fr=C3=B6hlinghaus?= <120580045+ThorstenFroehlinghaus@users.noreply.github.com> Date: Wed, 6 Nov 2024 08:27:12 +0100 Subject: [PATCH] add provider gruene-flotte_freiburg (#181) --- CHANGELOG.md | 3 + config/gruene-flotte_freiburg.json | 234 +++++++++++++++++++++++++++++ x2gbfs/x2gbfs.py | 2 +- 3 files changed, 238 insertions(+), 1 deletion(-) create mode 100644 config/gruene-flotte_freiburg.json diff --git a/CHANGELOG.md b/CHANGELOG.md index edf1288..3f145f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ The changelog lists most feature changes between each release. Search GitHub issues and pull requests for smaller issues. +## [unreleased] +- add Cantamen provider gruene-flotte_freiburg + ## 2024-10-30 - add Cantamen provider oekostadt_renningen - extend Cantamen provider stadtmobil_suedbaden with pricing for bookee class 'bike' diff --git a/config/gruene-flotte_freiburg.json b/config/gruene-flotte_freiburg.json new file mode 100644 index 0000000..ec670d3 --- /dev/null +++ b/config/gruene-flotte_freiburg.json @@ -0,0 +1,234 @@ +{ + "feed_data": { + "alerts": [ + { + "alert_id": "mobidatabw_1", + "description": "Keine Echtzeitdaten zum Buchungsstatus der Fahrzeuge. Verfügbarkeit ist im Buchungssystem des Anbieters sichtbar.", + "summary": "Keine Echtzeitdaten", + "type": "other" + } + ], + "pricing_plans": [ + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif XS - Stunde (0-7 Uhr)", + "per_min_pricing": [ { "start": 0, "end": 420, "interval": 60, "rate": 0 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.28 }, { "start": 101, "interval": 1, "rate": 0.23 } ], + "plan_id": "mini_hour_nighttime", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif XS - Stunde (7-24 Uhr)", + "per_min_pricing": [ { "start": 0, "end": 1020, "interval": 60, "rate": 1.60 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.28 }, { "start": 101, "interval": 1, "rate": 0.23 } ], + "plan_id": "mini_hour_daytime", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif XS - Tag (24 Stunden)", + "per_min_pricing": [ { "start": 0, "interval": 1440, "rate": 26.0 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.28 }, { "start": 101, "interval": 1, "rate": 0.23 } ], + "plan_id": "mini_hour_24hours", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif XS - Woche (7 Tage)", + "per_min_pricing": [ { "start": 0, "interval": 10080, "rate": 130.0 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.28 }, { "start": 101, "interval": 1, "rate": 0.23 } ], + "plan_id": "mini_week", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif S - Stunde (0-7 Uhr)", + "per_min_pricing": [ { "start": 0, "end": 420, "interval": 60, "rate": 0 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.28 }, { "start": 101, "interval": 1, "rate": 0.23 } ], + "plan_id": "small_hour_nighttime", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif S - Stunde (7-24 Uhr)", + "per_min_pricing": [ { "start": 0, "end": 1020, "interval": 60, "rate": 2.10 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.28 }, { "start": 101, "interval": 1, "rate": 0.23 } ], + "plan_id": "small_hour_daytime", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif S - Tag (24 Stunden)", + "per_min_pricing": [ { "start": 0, "interval": 1440, "rate": 33.0 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.28 }, { "start": 101, "interval": 1, "rate": 0.23 } ], + "plan_id": "small_hour_24hours", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif S - Woche (7 Tage)", + "per_min_pricing": [ { "start": 0, "interval": 10080, "rate": 165.0 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.28 }, { "start": 101, "interval": 1, "rate": 0.23 } ], + "plan_id": "small_week", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif L - Stunde (0-7 Uhr)", + "per_min_pricing": [ { "start": 0, "end": 420, "interval": 60, "rate": 0 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.36 }, { "start": 101, "interval": 1, "rate": 0.31 } ], + "plan_id": "large_hour_nighttime", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif L - Stunde (7-24 Uhr)", + "per_min_pricing": [ { "start": 0, "end": 1020, "interval": 60, "rate": 3.40 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.36 }, { "start": 101, "interval": 1, "rate": 0.31 } ], + "plan_id": "large_hour_daytime", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif L - Tag (24 Stunden)", + "per_min_pricing": [ { "start": 0, "interval": 1440, "rate": 51.0 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.36 }, { "start": 101, "interval": 1, "rate": 0.31 } ], + "plan_id": "large_hour_24hours", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif L - Woche (7 Tage)", + "per_min_pricing": [ { "start": 0, "interval": 10080, "rate": 260.0 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.36 }, { "start": 101, "interval": 1, "rate": 0.31 } ], + "plan_id": "large_week", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif XL - Stunde (0-7 Uhr)", + "per_min_pricing": [ { "start": 0, "end": 420, "interval": 60, "rate": 1.00 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.38 }, { "start": 101, "interval": 1, "rate": 0.33 } ], + "plan_id": "transporter_hour_nighttime", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif XL - Stunde (7-24 Uhr)", + "per_min_pricing": [ { "start": 0, "end": 1020, "interval": 60, "rate": 4.00 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.38 }, { "start": 101, "interval": 1, "rate": 0.33 } ], + "plan_id": "transporter_hour_daytime", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif XL - Tag (24 Stunden)", + "per_min_pricing": [ { "start": 0, "interval": 1440, "rate": 64.0 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.38 }, { "start": 101, "interval": 1, "rate": 0.33 } ], + "plan_id": "transporter_hour_24hours", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + }, + { + "currency": "EUR", + "description": "Für jede Buchung setzen sich die Nutzungskosten zusammen aus Zeittarif + Kilometertarif.", + "is_taxable": false, + "name": "Tarif XL - Woche (7 Tage)", + "per_min_pricing": [ { "start": 0, "interval": 10080, "rate": 310.0 } ], + "per_km_pricing": [ { "start": 0, "end": 100, "interval": 1, "rate": 0.38 }, { "start": 101, "interval": 1, "rate": 0.33 } ], + "plan_id": "transporter_week", + "price": 0, + "url": "https://gruene-flotte.com/carsharing/mietpreise-gruene-flotte/" + } + ], + "system_information": { + "email": "info@gruene-flotte-carsharing.de", + "feed_contact_email": "mobidata-bw@nvbw.de", + "language": "de", + "license_url": "https://www.govdata.de/dl-de/by-2-0", + "license_id": "DL-DE-BY-2.0", + "attribution_organization_name": "Die Grüne Flotte", + "attribution_url": "https://gruene-flotte.com/carsharing/", + "name": "Die Grüne Flotte", + "operator": "Autohaus Schmid Waldkirch GmbH", + "phone_number": "+49 (0)7681 4740080", + "privacy_url": "https://gruene-flotte.com/datenschutzerklaerung/", + "purchase_url": "https://gruene-flotte.com/carsharing/registrierung/", + "rental_apps": { + "android": { + "discovery_uri": "cantamen-interapp-csd://add_booking", + "store_uri": "https://play.google.com/store/apps/details?id=de.cantamen.carsharing.deutschland" + }, + "ios": { + "discovery_uri": "cantamen-interapp-csd://add_booking", + "store_uri": "https://apps.apple.com/de/app/carsharing-deutschland/id1075669223" + } + }, + "system_id": "gruene-flotte_freiburg", + "terms_last_updated": "2023-01-18", + "terms_url": "https://gruene-flotte.com/agb/", + "timezone": "Europe/Berlin", + "url": "https://gruene-flotte.com/carsharing/" + } + }, + "system_id": "10024", + "provider_id": 131, + "url_templates": { + "station": { + "android": "cantamen-interapp-csd://add_booking?openPlace={placeId}", + "ios": "cantamen-interapp-csd://add_booking?openPlace={placeId}", + "web": "https://ewi3.cantamen.de/?openPlace={placeId}" + }, + "vehicle": { + "android": "cantamen-interapp-csd://add_booking?openBookee={bookeeId}", + "ios": "cantamen-interapp-csd://add_booking?openBookee={bookeeId}", + "web": "https://ewi3.cantamen.de/?openBookee={bookeeId}" + } + } +} + diff --git a/x2gbfs/x2gbfs.py b/x2gbfs/x2gbfs.py index 0e1e41a..d81c9f3 100644 --- a/x2gbfs/x2gbfs.py +++ b/x2gbfs/x2gbfs.py @@ -46,7 +46,7 @@ def build_extractor(provider: str, feed_config: Dict[str, Any]) -> BaseProvider: return VoiRaumobil(api_url, api_user, api_password) if ( - provider in ['my-e-car', 'oekostadt_renningen'] + provider in ['my-e-car', 'oekostadt_renningen', 'gruene-flotte_freiburg'] or provider.startswith('stadtmobil_') or provider.startswith('teilauto_') ):