python-odpt
Advanced tools
+1
-1
| Metadata-Version: 2.1 | ||
| Name: python-odpt | ||
| Version: 0.1.3 | ||
| Version: 0.1.4 | ||
| Summary: Python client for ODPT(Open Data of Public Transportation) API | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/maru0123-2004/python-odpt/ |
+1
-1
| [tool.poetry] | ||
| name = "python-odpt" | ||
| version = "0.1.3" | ||
| version = "0.1.4" | ||
| description = "Python client for ODPT(Open Data of Public Transportation) API" | ||
@@ -5,0 +5,0 @@ authors = ["Maruo.S <raspi-maru2004@outlook.jp>"] |
@@ -9,3 +9,6 @@ from http import HTTPStatus | ||
| from ...models.dump_rdf_type import DumpRDFType | ||
| from ...models.dump_response import DumpResponse | ||
| from ...models import Calendar, Operator, Station, StationTimetable, TrainTimetable, TrainType, \ | ||
| RailDirection, Railway, RailwayFare, PassengerSurvey, BusTimetable, BusroutePattern, \ | ||
| BusroutePatternFare, BusstopPole, BusstopPoleTimetable, Airport, AirportTerminal, \ | ||
| FlightSchedule, FlightStatus, DumpRDFType | ||
| from ...types import UNSET, Response | ||
@@ -34,5 +37,10 @@ | ||
| OUTPUT_TYPES=Union["Calendar","Operator","Station","StationTimetable","TrainTimetable", | ||
| "TrainType","RailDirection","Railway","RailwayFare","PassengerSurvey", | ||
| "BusTimetable","BusroutePattern","BusroutePatternFare","BusstopPole", | ||
| "BusstopPoleTimetable","Airport","AirportTerminal","FlightSchedule","FlightStatus"] | ||
| def _parse_response( | ||
| *, client: Union[AuthenticatedClient, Client], response: httpx.Response | ||
| ) -> Optional[Union[Any, List["DumpResponse"]]]: | ||
| ) -> Optional[Union[Any, List[Union[OUTPUT_TYPES]]]]: | ||
| if response.status_code == 200: | ||
@@ -42,3 +50,40 @@ response_200 = [] | ||
| for response_200_item_data in _response_200: | ||
| response_200_item = DumpResponse.from_dict(response_200_item_data) | ||
| if response_200_item_data["@type"] == DumpRDFType.ODPTCALENDAR: | ||
| response_200_item = Calendar.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTOPERATOR: | ||
| response_200_item = Operator.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTSTATION: | ||
| response_200_item = Station.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTSTATIONTIMETABLE: | ||
| response_200_item = StationTimetable.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTTRAINTIMETABLE: | ||
| response_200_item = TrainTimetable.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTTRAINTYPE: | ||
| response_200_item = TrainType.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTRAILDIRECTION: | ||
| response_200_item = RailDirection.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTRAILWAY: | ||
| response_200_item = Railway.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTRAILWAYFARE: | ||
| response_200_item = RailwayFare.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTPASSENGERSURVEY: | ||
| response_200_item = PassengerSurvey.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSTIMETABLE: | ||
| response_200_item = BusTimetable.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSROUTEPATTERN: | ||
| response_200_item = BusroutePattern.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSROUTEPATTERNFARE: | ||
| response_200_item = BusroutePatternFare.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSSTOPPOLE: | ||
| response_200_item = BusstopPole.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSSTOPPOLETIMETABLE: | ||
| response_200_item = BusstopPoleTimetable.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTAIRPORT: | ||
| response_200_item = Airport.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTAIRPORTTERMINAL: | ||
| response_200_item = AirportTerminal.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTFLIGHTSCHEDULE: | ||
| response_200_item = FlightSchedule.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTFLIGHTSTATUS: | ||
| response_200_item = FlightStatus.from_dict(response_200_item_data) | ||
@@ -74,3 +119,3 @@ response_200.append(response_200_item) | ||
| *, client: Union[AuthenticatedClient, Client], response: httpx.Response | ||
| ) -> Response[Union[Any, List["DumpResponse"]]]: | ||
| ) -> Response[Union[Any, List[OUTPUT_TYPES]]]: | ||
| return Response( | ||
@@ -89,3 +134,3 @@ status_code=HTTPStatus(response.status_code), | ||
| aclconsumer_key: str, | ||
| ) -> Response[Union[Any, List["DumpResponse"]]]: | ||
| ) -> Response[Union[Any, List[OUTPUT_TYPES]]]: | ||
| """データダンプAPI | ||
@@ -102,3 +147,3 @@ | ||
| Returns: | ||
| Response[Union[Any, List['DumpResponse']]] | ||
| Response[Union[Any, List[OUTPUT_TYPES]]] | ||
| """ | ||
@@ -123,3 +168,3 @@ | ||
| aclconsumer_key: str, | ||
| ) -> Optional[Union[Any, List["DumpResponse"]]]: | ||
| ) -> Optional[Union[Any, List[OUTPUT_TYPES]]]: | ||
| """データダンプAPI | ||
@@ -136,3 +181,3 @@ | ||
| Returns: | ||
| Union[Any, List['DumpResponse']] | ||
| Union[Any, List[OUTPUT_TYPES]] | ||
| """ | ||
@@ -152,3 +197,3 @@ | ||
| aclconsumer_key: str, | ||
| ) -> Response[Union[Any, List["DumpResponse"]]]: | ||
| ) -> Response[Union[Any, List[OUTPUT_TYPES]]]: | ||
| """データダンプAPI | ||
@@ -165,3 +210,3 @@ | ||
| Returns: | ||
| Response[Union[Any, List['DumpResponse']]] | ||
| Response[Union[Any, List[OUTPUT_TYPES]]] | ||
| """ | ||
@@ -184,3 +229,3 @@ | ||
| aclconsumer_key: str, | ||
| ) -> Optional[Union[Any, List["DumpResponse"]]]: | ||
| ) -> Optional[Union[Any, List[OUTPUT_TYPES]]]: | ||
| """データダンプAPI | ||
@@ -197,3 +242,3 @@ | ||
| Returns: | ||
| Union[Any, List['DumpResponse']] | ||
| Union[Any, List[OUTPUT_TYPES]] | ||
| """ | ||
@@ -200,0 +245,0 @@ |
@@ -8,3 +8,6 @@ from http import HTTPStatus | ||
| from ...client import AuthenticatedClient, Client | ||
| from ...models.retrieve_response import RetrieveResponse | ||
| from ...models import Calendar, Operator, Station, StationTimetable, TrainTimetable, TrainType, \ | ||
| RailDirection, Railway, RailwayFare, PassengerSurvey, BusTimetable, BusroutePattern, \ | ||
| BusroutePatternFare, BusstopPole, BusstopPoleTimetable, Airport, AirportTerminal, \ | ||
| FlightSchedule, FlightStatus, DumpRDFType | ||
| from ...types import UNSET, Response | ||
@@ -32,6 +35,10 @@ | ||
| OUTPUT_TYPES=Union["Calendar","Operator","Station","StationTimetable","TrainTimetable", | ||
| "TrainType","RailDirection","Railway","RailwayFare","PassengerSurvey", | ||
| "BusTimetable","BusroutePattern","BusroutePatternFare","BusstopPole", | ||
| "BusstopPoleTimetable","Airport","AirportTerminal","FlightSchedule","FlightStatus"] | ||
| def _parse_response( | ||
| *, client: Union[AuthenticatedClient, Client], response: httpx.Response | ||
| ) -> Optional[Union[Any, List["RetrieveResponse"]]]: | ||
| ) -> Optional[Union[Any, List[Union[OUTPUT_TYPES]]]]: | ||
| if response.status_code == 200: | ||
@@ -41,3 +48,40 @@ response_200 = [] | ||
| for response_200_item_data in _response_200: | ||
| response_200_item = RetrieveResponse.from_dict(response_200_item_data) | ||
| if response_200_item_data["@type"] == DumpRDFType.ODPTCALENDAR: | ||
| response_200_item = Calendar.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTOPERATOR: | ||
| response_200_item = Operator.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTSTATION: | ||
| response_200_item = Station.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTSTATIONTIMETABLE: | ||
| response_200_item = StationTimetable.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTTRAINTIMETABLE: | ||
| response_200_item = TrainTimetable.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTTRAINTYPE: | ||
| response_200_item = TrainType.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTRAILDIRECTION: | ||
| response_200_item = RailDirection.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTRAILWAY: | ||
| response_200_item = Railway.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTRAILWAYFARE: | ||
| response_200_item = RailwayFare.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTPASSENGERSURVEY: | ||
| response_200_item = PassengerSurvey.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSTIMETABLE: | ||
| response_200_item = BusTimetable.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSROUTEPATTERN: | ||
| response_200_item = BusroutePattern.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSROUTEPATTERNFARE: | ||
| response_200_item = BusroutePatternFare.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSSTOPPOLE: | ||
| response_200_item = BusstopPole.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSSTOPPOLETIMETABLE: | ||
| response_200_item = BusstopPoleTimetable.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTAIRPORT: | ||
| response_200_item = Airport.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTAIRPORTTERMINAL: | ||
| response_200_item = AirportTerminal.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTFLIGHTSCHEDULE: | ||
| response_200_item = FlightSchedule.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTFLIGHTSTATUS: | ||
| response_200_item = FlightStatus.from_dict(response_200_item_data) | ||
@@ -73,3 +117,3 @@ response_200.append(response_200_item) | ||
| *, client: Union[AuthenticatedClient, Client], response: httpx.Response | ||
| ) -> Response[Union[Any, List["RetrieveResponse"]]]: | ||
| ) -> Response[Union[Any, List[OUTPUT_TYPES]]]: | ||
| return Response( | ||
@@ -88,3 +132,3 @@ status_code=HTTPStatus(response.status_code), | ||
| aclconsumer_key: str, | ||
| ) -> Response[Union[Any, List["RetrieveResponse"]]]: | ||
| ) -> Response[Union[Any, List[OUTPUT_TYPES]]]: | ||
| """データ取得API | ||
@@ -101,3 +145,3 @@ | ||
| Returns: | ||
| Response[Union[Any, List['RetrieveResponse']]] | ||
| Response[Union[Any, List[OUTPUT_TYPES]]] | ||
| """ | ||
@@ -122,3 +166,3 @@ | ||
| aclconsumer_key: str, | ||
| ) -> Optional[Union[Any, List["RetrieveResponse"]]]: | ||
| ) -> Optional[Union[Any, List[OUTPUT_TYPES]]]: | ||
| """データ取得API | ||
@@ -135,3 +179,3 @@ | ||
| Returns: | ||
| Union[Any, List['RetrieveResponse']] | ||
| Union[Any, List[OUTPUT_TYPES]] | ||
| """ | ||
@@ -151,3 +195,3 @@ | ||
| aclconsumer_key: str, | ||
| ) -> Response[Union[Any, List["RetrieveResponse"]]]: | ||
| ) -> Response[Union[Any, List[OUTPUT_TYPES]]]: | ||
| """データ取得API | ||
@@ -164,3 +208,3 @@ | ||
| Returns: | ||
| Response[Union[Any, List['RetrieveResponse']]] | ||
| Response[Union[Any, List[OUTPUT_TYPES]]] | ||
| """ | ||
@@ -183,3 +227,3 @@ | ||
| aclconsumer_key: str, | ||
| ) -> Optional[Union[Any, List["RetrieveResponse"]]]: | ||
| ) -> Optional[Union[Any, List[OUTPUT_TYPES]]]: | ||
| """データ取得API | ||
@@ -196,3 +240,3 @@ | ||
| Returns: | ||
| Union[Any, List['RetrieveResponse']] | ||
| Union[Any, List[OUTPUT_TYPES]] | ||
| """ | ||
@@ -199,0 +243,0 @@ |
@@ -8,3 +8,6 @@ from http import HTTPStatus | ||
| from ...client import AuthenticatedClient, Client | ||
| from ...models.data_search_response import DataSearchResponse | ||
| from ...models import Calendar, Operator, Station, StationTimetable, TrainTimetable, TrainType, \ | ||
| RailDirection, Railway, RailwayFare, PassengerSurvey, BusTimetable, BusroutePattern, \ | ||
| BusroutePatternFare, BusstopPole, BusstopPoleTimetable, Airport, AirportTerminal, \ | ||
| FlightSchedule, FlightStatus, DumpRDFType | ||
| from ...types import UNSET, Response, Unset | ||
@@ -17,3 +20,3 @@ | ||
| aclconsumer_key: str, | ||
| predicate: Union[Unset, str] = UNSET, | ||
| predicate: Dict[str, Any] = {}, | ||
| ) -> Dict[str, Any]: | ||
@@ -24,3 +27,3 @@ params: Dict[str, Any] = {} | ||
| params["PREDICATE"] = predicate | ||
| params.update(**predicate) | ||
@@ -37,6 +40,10 @@ params = {k: v for k, v in params.items() if v is not UNSET and v is not None} | ||
| OUTPUT_TYPES=Union["Calendar","Operator","Station","StationTimetable","TrainTimetable", | ||
| "TrainType","RailDirection","Railway","RailwayFare","PassengerSurvey", | ||
| "BusTimetable","BusroutePattern","BusroutePatternFare","BusstopPole", | ||
| "BusstopPoleTimetable","Airport","AirportTerminal","FlightSchedule","FlightStatus"] | ||
| def _parse_response( | ||
| *, client: Union[AuthenticatedClient, Client], response: httpx.Response | ||
| ) -> Optional[Union[Any, List["DataSearchResponse"]]]: | ||
| ) -> Optional[Union[Any, List[Union[OUTPUT_TYPES]]]]: | ||
| if response.status_code == 200: | ||
@@ -46,4 +53,41 @@ response_200 = [] | ||
| for response_200_item_data in _response_200: | ||
| response_200_item = DataSearchResponse.from_dict(response_200_item_data) | ||
| if response_200_item_data["@type"] == DumpRDFType.ODPTCALENDAR: | ||
| response_200_item = Calendar.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTOPERATOR: | ||
| response_200_item = Operator.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTSTATION: | ||
| response_200_item = Station.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTSTATIONTIMETABLE: | ||
| response_200_item = StationTimetable.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTTRAINTIMETABLE: | ||
| response_200_item = TrainTimetable.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTTRAINTYPE: | ||
| response_200_item = TrainType.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTRAILDIRECTION: | ||
| response_200_item = RailDirection.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTRAILWAY: | ||
| response_200_item = Railway.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTRAILWAYFARE: | ||
| response_200_item = RailwayFare.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTPASSENGERSURVEY: | ||
| response_200_item = PassengerSurvey.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSTIMETABLE: | ||
| response_200_item = BusTimetable.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSROUTEPATTERN: | ||
| response_200_item = BusroutePattern.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSROUTEPATTERNFARE: | ||
| response_200_item = BusroutePatternFare.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSSTOPPOLE: | ||
| response_200_item = BusstopPole.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTBUSSTOPPOLETIMETABLE: | ||
| response_200_item = BusstopPoleTimetable.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTAIRPORT: | ||
| response_200_item = Airport.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTAIRPORTTERMINAL: | ||
| response_200_item = AirportTerminal.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTFLIGHTSCHEDULE: | ||
| response_200_item = FlightSchedule.from_dict(response_200_item_data) | ||
| elif response_200_item_data["@type"] == DumpRDFType.ODPTFLIGHTSTATUS: | ||
| response_200_item = FlightStatus.from_dict(response_200_item_data) | ||
| response_200.append(response_200_item) | ||
@@ -78,3 +122,3 @@ | ||
| *, client: Union[AuthenticatedClient, Client], response: httpx.Response | ||
| ) -> Response[Union[Any, List["DataSearchResponse"]]]: | ||
| ) -> Response[Union[Any, List[OUTPUT_TYPES]]]: | ||
| return Response( | ||
@@ -93,4 +137,4 @@ status_code=HTTPStatus(response.status_code), | ||
| aclconsumer_key: str, | ||
| predicate: Union[Unset, str] = UNSET, | ||
| ) -> Response[Union[Any, List["DataSearchResponse"]]]: | ||
| predicate: Dict[str, Any] = {}, | ||
| ) -> Response[Union[Any, List[OUTPUT_TYPES]]]: | ||
| """データ検索API | ||
@@ -101,3 +145,3 @@ | ||
| aclconsumer_key (str): アクセストークン | ||
| predicate (Union[Unset, str]): | ||
| predicate (Dict[str, Any]): フィルター条件 | ||
@@ -109,3 +153,3 @@ Raises: | ||
| Returns: | ||
| Response[Union[Any, List['DataSearchResponse']]] | ||
| Response[Union[Any, List[OUTPUT_TYPES]]] | ||
| """ | ||
@@ -131,4 +175,4 @@ | ||
| aclconsumer_key: str, | ||
| predicate: Union[Unset, str] = UNSET, | ||
| ) -> Optional[Union[Any, List["DataSearchResponse"]]]: | ||
| predicate: Dict[str, Any] = {}, | ||
| ) -> Optional[Union[Any, List[OUTPUT_TYPES]]]: | ||
| """データ検索API | ||
@@ -139,3 +183,3 @@ | ||
| aclconsumer_key (str): アクセストークン | ||
| predicate (Union[Unset, str]): | ||
| predicate (Dict[str, Any]): フィルター条件 | ||
@@ -147,3 +191,3 @@ Raises: | ||
| Returns: | ||
| Union[Any, List['DataSearchResponse']] | ||
| Union[Any, List[OUTPUT_TYPES]] | ||
| """ | ||
@@ -164,4 +208,4 @@ | ||
| aclconsumer_key: str, | ||
| predicate: Union[Unset, str] = UNSET, | ||
| ) -> Response[Union[Any, List["DataSearchResponse"]]]: | ||
| predicate: Dict[str, Any] = {}, | ||
| ) -> Response[Union[Any, List[OUTPUT_TYPES]]]: | ||
| """データ検索API | ||
@@ -172,3 +216,3 @@ | ||
| aclconsumer_key (str): アクセストークン | ||
| predicate (Union[Unset, str]): | ||
| predicate (Dict[str, Any]): フィルター条件 | ||
@@ -180,3 +224,3 @@ Raises: | ||
| Returns: | ||
| Response[Union[Any, List['DataSearchResponse']]] | ||
| Response[Union[Any, List[OUTPUT_TYPES]]] | ||
| """ | ||
@@ -200,4 +244,4 @@ | ||
| aclconsumer_key: str, | ||
| predicate: Union[Unset, str] = UNSET, | ||
| ) -> Optional[Union[Any, List["DataSearchResponse"]]]: | ||
| predicate: Dict[str, Any] = {}, | ||
| ) -> Optional[Union[Any, List[OUTPUT_TYPES]]]: | ||
| """データ検索API | ||
@@ -208,3 +252,3 @@ | ||
| aclconsumer_key (str): アクセストークン | ||
| predicate (Union[Unset, str]): | ||
| predicate (Dict[str, Any]): フィルター条件 | ||
@@ -216,3 +260,3 @@ Raises: | ||
| Returns: | ||
| Union[Any, List['DataSearchResponse']] | ||
| Union[Any, List[OUTPUT_TYPES]] | ||
| """ | ||
@@ -219,0 +263,0 @@ |
@@ -28,5 +28,3 @@ """Contains all the data models used in inputs/outputs""" | ||
| from .calendar_type import CalendarType | ||
| from .data_search_response import DataSearchResponse | ||
| from .dump_rdf_type import DumpRDFType | ||
| from .dump_response import DumpResponse | ||
| from .flight_information_arrival import FlightInformationArrival | ||
@@ -58,3 +56,2 @@ from .flight_information_arrival_type import FlightInformationArrivalType | ||
| from .railway_ugregion import RailwayUgregion | ||
| from .retrieve_response import RetrieveResponse | ||
| from .station import Station | ||
@@ -61,0 +58,0 @@ from .station_order import StationOrder |
@@ -67,5 +67,5 @@ from typing import Any, Dict, List, Type, TypeVar, Union | ||
| d = src_dict.copy() | ||
| ja = d.pop("ja") | ||
| ja = d.pop("ja", UNSET) | ||
| en = d.pop("en") | ||
| en = d.pop("en", UNSET) | ||
@@ -72,0 +72,0 @@ ko = d.pop("ko", UNSET) |
| from typing import Any, Dict, List, Type, TypeVar, Union, cast | ||
| from attrs import define as _attrs_define | ||
| from attrs import field as _attrs_field | ||
| from ..types import UNSET, Unset | ||
| T = TypeVar("T", bound="DataSearchResponse") | ||
| @_attrs_define | ||
| class DataSearchResponse: | ||
| """データ検索APIのレスポンス | ||
| Attributes: | ||
| context (str): JSON-LD仕様に基づく @context のURL Example: http://vocab.odpt.org/context_odpt_Train.jsonld. | ||
| id (str): 固有識別子 | ||
| type (str): クラス名 Example: odpt:Train. | ||
| dcdate (str): ISO8601 日付時刻形式 | ||
| dctvalid (str): ISO8601 日付時刻形式 | ||
| odptfrequency (int): 更新頻度(秒)、指定された秒数以降にリクエストを行うことで、最新値が取得される。 Example: 30. | ||
| odptrailway (str): 固有識別子の別名 多くが`odpt.hoge:fuga`形式 | ||
| owlsame_as (str): 固有識別子の別名 多くが`odpt.hoge:fuga`形式 | ||
| odpttrain_number (str): 列車番号 Example: B1045S. | ||
| odpttrain_type (str): 固有識別子の別名 多くが`odpt.hoge:fuga`形式 | ||
| odptorigin_station (List[str]): 列車の始発駅のIDのリスト Example: ['odpt.Station:TokyoMetro.Yurakucho.ShinKiba']. | ||
| odptdestination_station (List[str]): 列車の終着駅のIDのリスト Example: ['odpt.Station:TokyoMetro.Yurakucho.Wakoshi']. | ||
| odptfrom_station (str): 固有識別子の別名 多くが`odpt.hoge:fuga`形式 | ||
| odptto_station (str): 固有識別子の別名 多くが`odpt.hoge:fuga`形式 | ||
| odptrail_direction (str): 固有識別子の別名 多くが`odpt.hoge:fuga`形式 | ||
| odptoperator (str): 固有識別子の別名 多くが`odpt.hoge:fuga`形式 | ||
| odptdelay (Union[Unset, int]): 遅延時間(秒) | ||
| """ | ||
| context: str | ||
| id: str | ||
| type: str | ||
| dcdate: str | ||
| dctvalid: str | ||
| odptfrequency: int | ||
| odptrailway: str | ||
| owlsame_as: str | ||
| odpttrain_number: str | ||
| odpttrain_type: str | ||
| odptorigin_station: List[str] | ||
| odptdestination_station: List[str] | ||
| odptfrom_station: str | ||
| odptto_station: str | ||
| odptrail_direction: str | ||
| odptoperator: str | ||
| odptdelay: Union[Unset, int] = UNSET | ||
| additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) | ||
| def to_dict(self) -> Dict[str, Any]: | ||
| context = self.context | ||
| id = self.id | ||
| type = self.type | ||
| dcdate = self.dcdate | ||
| dctvalid = self.dctvalid | ||
| odptfrequency = self.odptfrequency | ||
| odptrailway = self.odptrailway | ||
| owlsame_as = self.owlsame_as | ||
| odpttrain_number = self.odpttrain_number | ||
| odpttrain_type = self.odpttrain_type | ||
| odptorigin_station = self.odptorigin_station | ||
| odptdestination_station = self.odptdestination_station | ||
| odptfrom_station = self.odptfrom_station | ||
| odptto_station = self.odptto_station | ||
| odptrail_direction = self.odptrail_direction | ||
| odptoperator = self.odptoperator | ||
| odptdelay = self.odptdelay | ||
| field_dict: Dict[str, Any] = {} | ||
| field_dict.update(self.additional_properties) | ||
| field_dict.update( | ||
| { | ||
| "@context": context, | ||
| "@id": id, | ||
| "@type": type, | ||
| "dc:date": dcdate, | ||
| "dct:valid": dctvalid, | ||
| "odpt:frequency": odptfrequency, | ||
| "odpt:railway": odptrailway, | ||
| "owl:sameAs": owlsame_as, | ||
| "odpt:trainNumber": odpttrain_number, | ||
| "odpt:trainType": odpttrain_type, | ||
| "odpt:originStation": odptorigin_station, | ||
| "odpt:destinationStation": odptdestination_station, | ||
| "odpt:fromStation": odptfrom_station, | ||
| "odpt:toStation": odptto_station, | ||
| "odpt:railDirection": odptrail_direction, | ||
| "odpt:operator": odptoperator, | ||
| } | ||
| ) | ||
| if odptdelay is not UNSET: | ||
| field_dict["odpt:delay"] = odptdelay | ||
| return field_dict | ||
| @classmethod | ||
| def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: | ||
| d = src_dict.copy() | ||
| context = d.pop("@context") | ||
| id = d.pop("@id") | ||
| type = d.pop("@type") | ||
| dcdate = d.pop("dc:date") | ||
| dctvalid = d.pop("dct:valid") | ||
| odptfrequency = d.pop("odpt:frequency") | ||
| odptrailway = d.pop("odpt:railway") | ||
| owlsame_as = d.pop("owl:sameAs") | ||
| odpttrain_number = d.pop("odpt:trainNumber") | ||
| odpttrain_type = d.pop("odpt:trainType") | ||
| odptorigin_station = cast(List[str], d.pop("odpt:originStation")) | ||
| odptdestination_station = cast(List[str], d.pop("odpt:destinationStation")) | ||
| odptfrom_station = d.pop("odpt:fromStation") | ||
| odptto_station = d.pop("odpt:toStation") | ||
| odptrail_direction = d.pop("odpt:railDirection") | ||
| odptoperator = d.pop("odpt:operator") | ||
| odptdelay = d.pop("odpt:delay", UNSET) | ||
| data_search_response = cls( | ||
| context=context, | ||
| id=id, | ||
| type=type, | ||
| dcdate=dcdate, | ||
| dctvalid=dctvalid, | ||
| odptfrequency=odptfrequency, | ||
| odptrailway=odptrailway, | ||
| owlsame_as=owlsame_as, | ||
| odpttrain_number=odpttrain_number, | ||
| odpttrain_type=odpttrain_type, | ||
| odptorigin_station=odptorigin_station, | ||
| odptdestination_station=odptdestination_station, | ||
| odptfrom_station=odptfrom_station, | ||
| odptto_station=odptto_station, | ||
| odptrail_direction=odptrail_direction, | ||
| odptoperator=odptoperator, | ||
| odptdelay=odptdelay, | ||
| ) | ||
| data_search_response.additional_properties = d | ||
| return data_search_response | ||
| @property | ||
| def additional_keys(self) -> List[str]: | ||
| return list(self.additional_properties.keys()) | ||
| def __getitem__(self, key: str) -> Any: | ||
| return self.additional_properties[key] | ||
| def __setitem__(self, key: str, value: Any) -> None: | ||
| self.additional_properties[key] = value | ||
| def __delitem__(self, key: str) -> None: | ||
| del self.additional_properties[key] | ||
| def __contains__(self, key: str) -> bool: | ||
| return key in self.additional_properties |
| from typing import Any, Dict, List, Type, TypeVar | ||
| from attrs import define as _attrs_define | ||
| from attrs import field as _attrs_field | ||
| T = TypeVar("T", bound="DumpResponse") | ||
| @_attrs_define | ||
| class DumpResponse: | ||
| """データダンプAPIのレスポンス | ||
| Attributes: | ||
| context (str): JSON-LD仕様に基づく @context のURL Example: http://vocab.odpt.org/context_odpt.jsonld. | ||
| id (str): 固有識別子 | ||
| type (str): クラス名 Example: odpt:Station. | ||
| dctitle (str): 駅名(日本語) Example: 東京. | ||
| owlsame_as (str): 固有識別子の別名 多くが`odpt.hoge:fuga`形式 | ||
| """ | ||
| context: str | ||
| id: str | ||
| type: str | ||
| dctitle: str | ||
| owlsame_as: str | ||
| additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) | ||
| def to_dict(self) -> Dict[str, Any]: | ||
| context = self.context | ||
| id = self.id | ||
| type = self.type | ||
| dctitle = self.dctitle | ||
| owlsame_as = self.owlsame_as | ||
| field_dict: Dict[str, Any] = {} | ||
| field_dict.update(self.additional_properties) | ||
| field_dict.update( | ||
| { | ||
| "@context": context, | ||
| "@id": id, | ||
| "@type": type, | ||
| "dc:title": dctitle, | ||
| "owl:sameAs": owlsame_as, | ||
| } | ||
| ) | ||
| return field_dict | ||
| @classmethod | ||
| def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: | ||
| d = src_dict.copy() | ||
| context = d.pop("@context") | ||
| id = d.pop("@id") | ||
| type = d.pop("@type") | ||
| dctitle = d.pop("dc:title") | ||
| owlsame_as = d.pop("owl:sameAs") | ||
| dump_response = cls( | ||
| context=context, | ||
| id=id, | ||
| type=type, | ||
| dctitle=dctitle, | ||
| owlsame_as=owlsame_as, | ||
| ) | ||
| dump_response.additional_properties = d | ||
| return dump_response | ||
| @property | ||
| def additional_keys(self) -> List[str]: | ||
| return list(self.additional_properties.keys()) | ||
| def __getitem__(self, key: str) -> Any: | ||
| return self.additional_properties[key] | ||
| def __setitem__(self, key: str, value: Any) -> None: | ||
| self.additional_properties[key] = value | ||
| def __delitem__(self, key: str) -> None: | ||
| del self.additional_properties[key] | ||
| def __contains__(self, key: str) -> bool: | ||
| return key in self.additional_properties |
| from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, cast | ||
| from attrs import define as _attrs_define | ||
| from attrs import field as _attrs_field | ||
| if TYPE_CHECKING: | ||
| from ..models.multilingual_title import MultilingualTitle | ||
| T = TypeVar("T", bound="RetrieveResponse") | ||
| @_attrs_define | ||
| class RetrieveResponse: | ||
| """データ取得APIのレスポンス | ||
| Attributes: | ||
| context (str): JSON-LD仕様に基づく @context のURL Example: http://vocab.odpt.org/context_odpt_Station.jsonld. | ||
| id (str): 固有識別子 | ||
| type (str): クラス名 Example: odpt:Station. | ||
| dcdate (str): ISO8601 日付時刻形式 | ||
| dctitle (str): 駅名(日本語) Example: 上野. | ||
| geolat (float): 緯度 Example: 35.711835. | ||
| geolong (float): 経度 Example: 139.775625. | ||
| owlsame_as (str): 固有識別子の別名 多くが`odpt.hoge:fuga`形式 | ||
| odptrailway (str): 固有識別子の別名 多くが`odpt.hoge:fuga`形式 | ||
| odptoperator (str): 固有識別子の別名 多くが`odpt.hoge:fuga`形式 | ||
| odptstation_code (str): 駅コード Example: G16. | ||
| odptstation_title (MultilingualTitle): 多言語対応のタイトル | ||
| odptpassenger_survey (List[str]): 駅乗降人員数を表すIDのリスト Example: ['odpt.PassengerSurvey:TokyoMetro.Ueno']. | ||
| odptstation_timetable (List[str]): 駅時刻表を表すIDのリスト Example: | ||
| ['odpt.StationTimetable:TokyoMetro.Ginza.Ueno.TokyoMetro.Shibuya.Weekday']. | ||
| odptconnecting_railway (List[str]): 乗り換え可能路線のIDのリスト Example: ['odpt.Railway:TokyoMetro.Hibiya', | ||
| 'odpt.Railway:JR-East.AkitaShinkansen']. | ||
| odptconnecting_station (List[str]): 乗り換え可能駅のIDのリスト Example: ['odpt.Station:TokyoMetro.Hibiya.Ueno', | ||
| 'odpt.Station:JR-East.AkitaShinkansen.Ueno']. | ||
| """ | ||
| context: str | ||
| id: str | ||
| type: str | ||
| dcdate: str | ||
| dctitle: str | ||
| geolat: float | ||
| geolong: float | ||
| owlsame_as: str | ||
| odptrailway: str | ||
| odptoperator: str | ||
| odptstation_code: str | ||
| odptstation_title: "MultilingualTitle" | ||
| odptpassenger_survey: List[str] | ||
| odptstation_timetable: List[str] | ||
| odptconnecting_railway: List[str] | ||
| odptconnecting_station: List[str] | ||
| additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) | ||
| def to_dict(self) -> Dict[str, Any]: | ||
| context = self.context | ||
| id = self.id | ||
| type = self.type | ||
| dcdate = self.dcdate | ||
| dctitle = self.dctitle | ||
| geolat = self.geolat | ||
| geolong = self.geolong | ||
| owlsame_as = self.owlsame_as | ||
| odptrailway = self.odptrailway | ||
| odptoperator = self.odptoperator | ||
| odptstation_code = self.odptstation_code | ||
| odptstation_title = self.odptstation_title.to_dict() | ||
| odptpassenger_survey = self.odptpassenger_survey | ||
| odptstation_timetable = self.odptstation_timetable | ||
| odptconnecting_railway = self.odptconnecting_railway | ||
| odptconnecting_station = self.odptconnecting_station | ||
| field_dict: Dict[str, Any] = {} | ||
| field_dict.update(self.additional_properties) | ||
| field_dict.update( | ||
| { | ||
| "@context": context, | ||
| "@id": id, | ||
| "@type": type, | ||
| "dc:date": dcdate, | ||
| "dc:title": dctitle, | ||
| "geo:lat": geolat, | ||
| "geo:long": geolong, | ||
| "owl:sameAs": owlsame_as, | ||
| "odpt:railway": odptrailway, | ||
| "odpt:operator": odptoperator, | ||
| "odpt:stationCode": odptstation_code, | ||
| "odpt:stationTitle": odptstation_title, | ||
| "odpt:passengerSurvey": odptpassenger_survey, | ||
| "odpt:stationTimetable": odptstation_timetable, | ||
| "odpt:connectingRailway": odptconnecting_railway, | ||
| "odpt:connectingStation": odptconnecting_station, | ||
| } | ||
| ) | ||
| return field_dict | ||
| @classmethod | ||
| def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: | ||
| from ..models.multilingual_title import MultilingualTitle | ||
| d = src_dict.copy() | ||
| context = d.pop("@context") | ||
| id = d.pop("@id") | ||
| type = d.pop("@type") | ||
| dcdate = d.pop("dc:date") | ||
| dctitle = d.pop("dc:title") | ||
| geolat = d.pop("geo:lat") | ||
| geolong = d.pop("geo:long") | ||
| owlsame_as = d.pop("owl:sameAs") | ||
| odptrailway = d.pop("odpt:railway") | ||
| odptoperator = d.pop("odpt:operator") | ||
| odptstation_code = d.pop("odpt:stationCode") | ||
| odptstation_title = MultilingualTitle.from_dict(d.pop("odpt:stationTitle")) | ||
| odptpassenger_survey = cast(List[str], d.pop("odpt:passengerSurvey")) | ||
| odptstation_timetable = cast(List[str], d.pop("odpt:stationTimetable")) | ||
| odptconnecting_railway = cast(List[str], d.pop("odpt:connectingRailway")) | ||
| odptconnecting_station = cast(List[str], d.pop("odpt:connectingStation")) | ||
| retrieve_response = cls( | ||
| context=context, | ||
| id=id, | ||
| type=type, | ||
| dcdate=dcdate, | ||
| dctitle=dctitle, | ||
| geolat=geolat, | ||
| geolong=geolong, | ||
| owlsame_as=owlsame_as, | ||
| odptrailway=odptrailway, | ||
| odptoperator=odptoperator, | ||
| odptstation_code=odptstation_code, | ||
| odptstation_title=odptstation_title, | ||
| odptpassenger_survey=odptpassenger_survey, | ||
| odptstation_timetable=odptstation_timetable, | ||
| odptconnecting_railway=odptconnecting_railway, | ||
| odptconnecting_station=odptconnecting_station, | ||
| ) | ||
| retrieve_response.additional_properties = d | ||
| return retrieve_response | ||
| @property | ||
| def additional_keys(self) -> List[str]: | ||
| return list(self.additional_properties.keys()) | ||
| def __getitem__(self, key: str) -> Any: | ||
| return self.additional_properties[key] | ||
| def __setitem__(self, key: str, value: Any) -> None: | ||
| self.additional_properties[key] = value | ||
| def __delitem__(self, key: str) -> None: | ||
| del self.additional_properties[key] | ||
| def __contains__(self, key: str) -> bool: | ||
| return key in self.additional_properties |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
502890
-0.77%107
-2.73%11157
-1.89%