Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add providers oberschwabenmobil, gmuend_bewegt #193

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

The changelog lists most feature changes between each release. Search GitHub issues and pull requests for smaller issues.

## unreleased
- add MOQO providers oberschwabenmobil, gmuend_beweg

## 2024-11-29
- add CambioProvider and feed `cambio_aachen`.

Expand Down
4 changes: 2 additions & 2 deletions config/flinkster_carsharing.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@
"rental_apps": {
"android": {
"discovery_uri": "https://go.moqo.de/deeplink/openApp",
"store_uri": "https://play.google.com/store/apps/details?id=de.zeagenergie.sharing.app&gl=DE"
"store_uri": "https://play.google.com/store/apps/details?id=de.flinkster.sharing.app"
},
"ios": {
"discovery_uri": "https://go.moqo.de/deeplink/openApp",
"store_uri": "https://apps.apple.com/de/app/zeag-carsharing/id1579488967"
"store_uri": "https://apps.apple.com/us/app/flinkster/id6639612291?mt=8"
}
},
"system_id": "flinkster",
Expand Down
60 changes: 60 additions & 0 deletions config/gmuend_bewegt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"feed_data": {
"pricing_plans": [
{
"currency": "EUR",
"description": "Stundentarif: 5,90€ zzgl. 0,19€/km. Alle Angaben ohne Gewähr.",
"is_taxable": false,
"name": "Stundentarif",
"per_min_pricing": [ { "start": 0, "interval": 60, "rate": 5.50 } ],
"per_km_pricing": [ { "start": 0, "interval": 1, "rate": 0.19 } ],
"plan_id": "compact_car_hour_daytime",
"price": 0,
"url": "https://www.stwgd.de/files/stadtwerke_gd/userfiles/pdf/Mobilit%C3%A4t/E-Carsharing/Preisblatt_Stand%2001.05.2023.pdf"
},
{
"currency": "EUR",
"description": "Tagestarif: 47,90€ zzgl. 0,19€/km. Alle Angaben ohne Gewähr.",
"is_taxable": false,
"name": "Tagestarif",
"per_min_pricing": [ { "start": 0, "interval": 1440, "rate": 47.90 } ],
"per_km_pricing": [ { "start": 0, "interval": 1, "rate": 0.19 } ],
"plan_id": "compact_car_day",
"price": 0,
"url": "https://www.stwgd.de/files/stadtwerke_gd/userfiles/pdf/Mobilit%C3%A4t/E-Carsharing/Preisblatt_Stand%2001.05.2023.pdf"
}
],
"system_information": {
"attribution_organization_name": "Stadtwerke Schwäbisch Gmünd GmbH",
"attribution_url": "https://www.stwgd.de/",
"email": "[email protected]",
"feed_contact_email": "[email protected]",
"language": "de",
"license_id": "DL-DE-BY-2.0",
"license_url": "https://www.govdata.de/dl-de/by-2-0",
"name": "Gmünd bewegt!",
"operator": "Stadtwerke Schwäbisch Gmünd GmbH",
"phone_number": "+49 (0)7171 603-8222",
"privacy_url": "https://www.stwgd.de/datenschutz.html",
"purchase_url": "https://portal.moqo.de/js_sign_up/gmund-bewegt#/account",
"rental_apps": {
"android": {
"discovery_uri": "https://go.moqo.de/deeplink/openApp",
"store_uri": "https://play.google.com/store/apps/details?id=de.moqo.work"
},
"ios": {
"discovery_uri": "https://go.moqo.de/deeplink/openApp",
"store_uri": "https://apps.apple.com/de/app/moqo/id1385011262"
}
},
"system_id": "gmuend_bewegt",
"terms_url": "https://www.stwgd.de/files/stadtwerke_gd/userfiles/pdf/Mobilit%C3%A4t/E-Carsharing/AGB%20Gm%C3%BCnd%20bewegt!.pdf",
"timezone": "Europe/Berlin",
"url": "https://www.stwgd.de/privatkunden/mobilitaet/e-carsharing.html"
}
},
"provider_data": {
"team_id": "196572225"
}
}

124 changes: 124 additions & 0 deletions config/oberschwabenmobil.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"feed_data": {
"pricing_plans": [
{
"currency": "EUR",
"description": "Stundentarif: 3,00€ zzgl. 0,35€/km. Alle Angaben ohne Gewähr.",
"is_taxable": false,
"name": "Kleinwagen - EinfachMobil Stundentarif",
"per_min_pricing": [ { "start": 0, "interval": 60, "rate": 3.00 } ],
"per_km_pricing": [ { "start": 0, "interval": 1, "rate": 0.35 } ],
"plan_id": "small_family_car_hour_daytime",
"price": 0,
"url": "https://www.oberschwabenmobil.de/Preis.html"
},
{
"currency": "EUR",
"description": "Tagestarif: 30,00€ zzgl. 0,35€/km. Alle Angaben ohne Gewähr.",
"is_taxable": false,
"name": "Kleinwagen - EinfachMobil Tagestarif",
"per_min_pricing": [ { "start": 0, "interval": 1440, "rate": 30.00 } ],
"per_km_pricing": [ { "start": 0, "interval": 1, "rate": 0.35 } ],
"plan_id": "small_family_car_day",
"price": 0,
"url": "https://www.oberschwabenmobil.de/Preis.html"
},
{
"currency": "EUR",
"description": "Stundentarif: 3,00€ zzgl. 0,35€/km. Alle Angaben ohne Gewähr.",
"is_taxable": false,
"name": "Kompaktwagen - EinfachMobil Stundentarif",
"per_min_pricing": [ { "start": 0, "interval": 60, "rate": 3.00 } ],
"per_km_pricing": [ { "start": 0, "interval": 1, "rate": 0.35 } ],
"plan_id": "compact_car_hour_daytime",
"price": 0,
"url": "https://www.oberschwabenmobil.de/Preis.html"
},
{
"currency": "EUR",
"description": "Tagestarif: 30,00€ zzgl. 0,35€/km. Alle Angaben ohne Gewähr.",
"is_taxable": false,
"name": "Kompaktwagen - EinfachMobil Tagestarif",
"per_min_pricing": [ { "start": 0, "interval": 1440, "rate": 30.00 } ],
"per_km_pricing": [ { "start": 0, "interval": 1, "rate": 0.35 } ],
"plan_id": "compact_car_day",
"price": 0,
"url": "https://www.oberschwabenmobil.de/Preis.html"
},
{
"currency": "EUR",
"description": "Stundentarif: 3,50€ zzgl. 0,41€/km. Alle Angaben ohne Gewähr.",
"is_taxable": false,
"name": "Limousine - EinfachMobil Stundentarif",
"per_min_pricing": [ { "start": 0, "interval": 60, "rate": 3.50 } ],
"per_km_pricing": [ { "start": 0, "interval": 1, "rate": 0.41 } ],
"plan_id": "limousine_hour_daytime",
"price": 0,
"url": "https://www.oberschwabenmobil.de/Preis.html"
},
{
"currency": "EUR",
"description": "Tagestarif: 35,00€ zzgl. 0,41€/km. Alle Angaben ohne Gewähr.",
"is_taxable": false,
"name": "Limousine - EinfachMobil Tagestarif",
"per_min_pricing": [ { "start": 0, "interval": 1440, "rate": 35.00 } ],
"per_km_pricing": [ { "start": 0, "interval": 1, "rate": 0.41 } ],
"plan_id": "limousine_day",
"price": 0,
"url": "https://www.oberschwabenmobil.de/Preis.html"
},
{
"currency": "EUR",
"description": "Stundentarif: 3,50€ zzgl. 0,41€/km. Alle Angaben ohne Gewähr.",
"is_taxable": false,
"name": "Kombiwagen - EinfachMobil Stundentarif",
"per_min_pricing": [ { "start": 0, "interval": 60, "rate": 3.50 } ],
"per_km_pricing": [ { "start": 0, "interval": 1, "rate": 0.41 } ],
"plan_id": "station_wagon_hour_daytime",
"price": 0,
"url": "https://www.oberschwabenmobil.de/Preis.html"
},
{
"currency": "EUR",
"description": "Tagestarif: 35,00€ zzgl. 0,41€/km. Alle Angaben ohne Gewähr.",
"is_taxable": false,
"name": "Kombiwagen - EinfachMobil Tagestarif",
"per_min_pricing": [ { "start": 0, "interval": 1440, "rate": 35.00 } ],
"per_km_pricing": [ { "start": 0, "interval": 1, "rate": 0.41 } ],
"plan_id": "station_wagon_day",
"price": 0,
"url": "https://www.oberschwabenmobil.de/Preis.html"
}
],
"system_information": {
"attribution_organization_name": "OberSchwabenMobil e.V.",
"attribution_url": "https://www.oberschwabenmobil.de/",
"email": "[email protected]",
"feed_contact_email": "[email protected]",
"language": "de",
"license_id": "DL-DE-BY-2.0",
"license_url": "https://www.govdata.de/dl-de/by-2-0",
"name": "OberSchwabenMobil CarSharing",
"operator": "OberSchwabenMobil e.V.",
"phone_number": "+49 (0)241 95788-366",
"purchase_url": "https://www.oberschwabenmobil.de/Verein.html",
"rental_apps": {
"android": {
"discovery_uri": "https://go.moqo.de/deeplink/openApp",
"store_uri": "https://play.google.com/store/apps/details?id=de.moqo.work"
},
"ios": {
"discovery_uri": "https://go.moqo.de/deeplink/openApp",
"store_uri": "https://apps.apple.com/us/app/moqo/id1385011262"
}
},
"system_id": "oberschwabenmobil",
"timezone": "Europe/Berlin",
"url": "https://www.oberschwabenmobil.de/"
}
},
"provider_data": {
"team_id": "1154505515"
}
}

6 changes: 4 additions & 2 deletions x2gbfs/providers/moqo.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,13 @@ def _extract_from_parkings(
'name': elem['name'],
'lat': center['lat'],
'lon': center['lng'],
'address': address,
'post_code': elem['zipcode'],
'rental_methods': ['key'],
}

if address:
station['address'] = address
Comment on lines +150 to +151
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are address / their components really optional? Above, you access them via [], are the properties contained but empty?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oberschwaben Mobil has a station "RV-Nordstadt" with geocoordinates, but without any address information. The attributes town, zipcode, street, streetnumber are available, but they are = "".

if elem.get('zipcode'):
station['post_code'] = elem['zipcode']
if elem.get('capacity_max'):
station['capacity'] = elem['capacity_max']

Expand Down
10 changes: 7 additions & 3 deletions x2gbfs/x2gbfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@ def build_extractor(provider: str, feed_config: Dict[str, Any]) -> BaseProvider:
or provider.startswith('teilauto_')
):
return CantamenIXSIProvider(feed_config)
if provider in ['stadtwerk_tauberfranken', 'zeag_energie', 'flinkster_carsharing']:
if provider in [
'stadtwerk_tauberfranken',
'zeag_energie',
'flinkster_carsharing',
'oberschwabenmobil',
'gmuend_bewegt',
]:
return MoqoProvider(feed_config)
if provider in ['noi']:
return NoiProvider()
if provider in ['flinkster']:
return FlinksterProvider(feed_config)
Comment on lines -61 to -62
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An oversight in the review: you removed the flinkster option here, but kept the import, the config and the FlinksterProvider itself. Either it should be removed completely or kept here as well.


raise ValueError(f'Unknown config {provider}')

Expand Down
Loading