pyemtmad.api.parking module¶
This file contains the endpoints for parking services.
See https://servicios.emtmadrid.es:8443/InfoParking/InfoParking.svc/json/help
-
class
pyemtmad.api.parking.
ParkingApi
(wrapper)¶ Bases:
object
Metaclass that contains the API methods for the parking endpoints.
-
detail_parking
(**kwargs)¶ Obtain detailed info of a given parking.
Parameters: - lang (str) – Language code (es or en).
- 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.
- hour (int) – Hour of the day in format hh. The number is automatically padded if it only has one digit.
- minute (int) – Minute of the hour in format mm. The number is automatically padded if it only has one digit.
- parking (int) – ID of the parking to query.
- family (str) – Family code of the parking (3 chars).
Returns: Status boolean and parsed response (list[ParkingDetails]), or message string in case of error.
-
detail_poi
(**kwargs)¶ Obtain detailed info of a given POI.
Parameters: - family (str) – Family code of the POI (3 chars).
- lang (str) – Language code (es or en).
- id (int) – Optional, ID of the POI to query. Passing value -1 will result in information from all POIs.
Returns: Status boolean and parsed response (list[PoiDetails]), or message string in case of error.
-
icon_description
(**kwargs)¶ Obtain a list of elements that have an associated icon.
Parameters: lang (str) – Language code (es or en). Returns: Status boolean and parsed response (list[IconDescription]), or message string in case of error.
-
info_parking_poi
(**kwargs)¶ Obtain generic information on POIs and parkings.
This returns a list of elements in a given radius from the coordinates.
Parameters: - radius (int) – Radius of the search (in meters).
- latitude (double) – Latitude in decimal degrees.
- longitude (double) – Longitude in decimal degrees.
- lang (str) – Language code (es or en).
- 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.
- hour (int) – Hour of the day in format hh. The number is automatically padded if it only has one digit.
- minute (int) – Minute of the hour in format mm. The number is automatically padded if it only has one digit.
- poi_info (list[tuple]) – List of tuples with the format
(list[family], type, category)
to query. Check the API documentation. - min_free (list[int]) – Number of free spaces to check. Must have the
same length of
poi_info
. - field_codes (list[tuple]) – List of tuples with the format
(list[codes], name)
. Check the API documentation.
Returns: Status boolean and parsed response (list[InfoParkingPoi]), or message string in case of error.
-
list_features
(**kwargs)¶ Obtain a list of parkings.
Parameters: lang (str) – Language code (es or en). Returns: Status boolean and parsed response (list[Parking]), or message string in case of error.
-
list_parking
(**kwargs)¶ Obtain a list of parkings.
Parameters: lang (str) – Language code (es or en). Returns: Status boolean and parsed response (list[Parking]), or message string in case of error.
-
list_street_poi_parking
(**kwargs)¶ Obtain a list of addresses and POIs.
This endpoint uses an address to perform the search
Parameters: - lang (str) – Language code (es or en).
- address (str) – Address in which to perform the search.
Returns: Status boolean and parsed response (list[ParkingPoi]), or message string in case of error.
-
list_types_poi
(**kwargs)¶ Obtain a list of families, types and categories of POI.
Parameters: lang (str) – Language code (es or en). Returns: Status boolean and parsed response (list[ParkingPoiType]), or message string in case of error.
-