Skip to content

Commit

Permalink
add missing mapping, README
Browse files Browse the repository at this point in the history
  • Loading branch information
the-infinity committed Jun 9, 2024
1 parent 324cfd1 commit 997d8af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ We support following data sources:

| name | purpose | type | uid | realtime |
|-----------------------------------------------------------------------------------|---------|-------------|----------------------|----------|
| A81: P&M | car | pull | `a81_p_m` | yes |
| Deutsche Bahn | car | pull | `bahn_v2` | no |
| Barrierefreie Reisekette Baden-Württemberg: PKW-Parkplätze an Bahnhöfen | car | push (csv) | `bfrk_bw_oepnv_car` | no |
| Barrierefreie Reisekette Baden-Württemberg: PKW-Parkplätze an Bushaltestellen | car | push (csv) | `bfrk_bw_spnv_car` | no |
Expand Down
5 changes: 4 additions & 1 deletion src/parkapi_sources/converters/a81_p_m/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from validataclass.validators import DataclassValidator, EnumValidator, IntegerValidator, NumericValidator, StringValidator

from parkapi_sources.models import RealtimeParkingSiteInput, StaticParkingSiteInput
from parkapi_sources.models.enums import ParkAndRideType
from parkapi_sources.validators import SpacedDateTimeValidator


Expand Down Expand Up @@ -45,13 +46,14 @@ class A81PMInput:
id: str = StringValidator()
long_name: str = StringValidator()
name: str = StringValidator()
status: A81PMConnectionStatus = EnumValidator(A81PMConnectionStatus)
status: A81PMConnectionStatus = EnumValidator(A81PMConnectionStatus) # TODO: what's that?
time: datetime = SpacedDateTimeValidator(
local_timezone=ZoneInfo('Europe/Berlin'),
target_timezone=timezone.utc,
)
location: A81PMLocationInput = DataclassValidator(A81PMLocationInput)
capacity: A81PMCapacityInput = DataclassValidator(A81PMCapacityInput)
category: A81PMCategory = EnumValidator(A81PMCategory)
free_capacity: A81PMCapacityInput = DataclassValidator(A81PMCapacityInput)

def to_static_parking_site(self) -> StaticParkingSiteInput:
Expand All @@ -65,6 +67,7 @@ def to_static_parking_site(self) -> StaticParkingSiteInput:
capacity_woman=self.capacity.car_women,
lat=self.location.lat,
lon=self.location.lng,
park_and_ride_type=[ParkAndRideType.YES] if self.category == A81PMCategory.P_M else None,
)

def to_realtime_parking_site(self) -> RealtimeParkingSiteInput:
Expand Down

0 comments on commit 997d8af

Please sign in to comment.