pyemtmad.api.bus module¶
This file contains the endpoints for bus services.
See http://opendata.emtmadrid.es/Servicios-web/BUS
-
class
pyemtmad.api.bus.
BusApi
(wrapper)¶ Bases:
object
Metaclass that contains the API methods for the bus endpoints.
-
get_calendar
(**kwargs)¶ Obtain EMT calendar for a range of dates.
Parameters: - start_day (int) – Starting day of the month in format DD. The number is automatically padded if it only has one digit.
- start_month (int) – Starting month number in format MM. The number is automatically padded if it only has one digit.
- start_year (int) – Starting year number in format YYYY.
- end_day (int) – Ending day of the month in format DD. The number is automatically padded if it only has one digit.
- end_month (int) – Ending month number in format MM. The number is automatically padded if it only has one digit.
- end_year (int) – Ending year number in format YYYY.
Returns: Status boolean and parsed response (list[CalendarItem]), or message string in case of error.
-
get_groups
(**kwargs)¶ Obtain line types and details.
Parameters: lang (str) – Language code (es or en). Returns: Status boolean and parsed response (list[BusGroupItem]), or message string in case of error.
-
get_list_lines
(**kwargs)¶ Obtain lines with description and group.
Parameters: - day (int) – Day of the month in format DD. The number is automatically padded if it only has one digit.
- month (int) – Month number in format MM. The number is automatically padded if it only has one digit.
- year (int) – Year number in format YYYY.
- lines (list[int] | int) – Lines to query, may be empty to get all the lines.
Returns: Status boolean and parsed response (list[ListLineInfo]), or message string in case of error.
-
get_nodes_lines
(**kwargs)¶ Obtain stop IDs, coordinates and line information.
Parameters: nodes (list[int] | int) – nodes to query, may be empty to get all nodes. Returns: Status boolean and parsed response (list[NodeLinesItem]), or message string in case of error.
-
get_route_lines
(**kwargs)¶ Obtain itinerary for one or more lines in the given date.
Parameters: - day (int) – Day of the month in format DD. The number is automatically padded if it only has one digit.
- month (int) – Month number in format MM. The number is automatically padded if it only has one digit.
- year (int) – Year number in format YYYY.
- lines (list[int] | int) – Lines to query, may be empty to get all the lines.
Returns: Status boolean and parsed response (list[RouteLinesItem]), or message string in case of error.
-
get_route_lines_route
(**kwargs)¶ Obtain itinerary for one or more lines in the given date.
Parameters: - day (int) – Day of the month in format DD. The number is automatically padded if it only has one digit.
- month (int) – Month number in format MM. The number is automatically padded if it only has one digit.
- year (int) – Year number in format YYYY.
- lines (list[int] | int) – Lines to query, may be empty to get all the lines.
Returns: Status boolean and parsed response (list[RouteLinesItem]), or message string in case of error.
-
get_times_lines
(**kwargs)¶ Obtain current line times for the given lines.
Parameters: - day (int) – Day of the month in format DD. The number is automatically padded if it only has one digit.
- month (int) – Month number in format MM. The number is automatically padded if it only has one digit.
- year (int) – Year number in format YYYY.
- lines (list[int] | int) – Lines to query, may be empty to get all the lines.
Returns: Status boolean and parsed response (list[TimesLinesItem]), or message string in case of error.
-
get_timetable_lines
(**kwargs)¶ Obtain information on lines for a travel.
Parameters: - day (int) – Day of the month in format DD. The number is automatically padded if it only has one digit.
- month (int) – Month number in format MM. The number is automatically padded if it only has one digit.
- year (int) – Year number in format YYYY.
- lines (list[int] | int) – Lines to query, may be empty to get all the lines.
Returns: Status boolean and parsed response (list[TimetableLinesItem]), or message string in case of error.
-