api_etl.utils_api_client module

Module used to query Transilien’s API.

class api_etl.utils_api_client.ApiClient(user='****', password='****', retry_timeout=20, core_url='http://api.transilien.com/')

Bases: object

This class provide a client to process requests to transilien’s API. It provides methods to process either single queries, or asynchronous batch queries that rely on asyncio library.

request_station(station, verbose=False, extra_params=None)

This method process a single query.

Parameters:
  • verbose
  • extra_params
  • station (str/int (8 digits format)) – station you want to query (8 digits format)
Return type:

str (xml answer)

request_stations(station_list)

This method process asynchronous batch queries. It will return answers with station ids so that you can identify stations answers.

Parameters:station_list – list of station_ids in the 8 digits format used by transilien’s API

to identify stations (warning: different than station ids in GTFS files that are 7 digits). :type station_list: list of str

Return type:list of tuples (api_response, station_id)