Skip to content

Lift Disruptions Handler

A handler to interact with the Lift Disruptions V2 API.

LiftDisruptionsV2Handler

Bases: base.TFLHandler

A handler to interact with the Lift Disruptions V2 API.

API reference

Example
from tfl import clients


async with clients.TFLClient(auth=clients.Auth(key="<your-tfl-api-key>")) as client:
    response = await LiftDisruptionsV2Handler(client).get_lift_disruptions()

print(response.json())
Source code in tfl/clients/handlers/_lift_disruptions_handler.py
class LiftDisruptionsV2Handler(base.TFLHandler):
    """A handler to interact with the Lift Disruptions V2 API.

    [API reference](https://api-portal.tfl.gov.uk/api-details#api=Disruptions-Lifts-v2&operation=get)

    Example:
        ```python
        from tfl import clients


        async with clients.TFLClient(auth=clients.Auth(key="<your-tfl-api-key>")) as client:
            response = await LiftDisruptionsV2Handler(client).get_lift_disruptions()

        print(response.json())
        ```
    """

    async def get_lift_disruptions(self) -> httpx.Response:
        """Get all current lift disruptions.

        Returns:
            The response from the API.
        """
        return await self.client.get(url="Disruptions/Lifts/v2")

get_lift_disruptions() async

Get all current lift disruptions.

Returns:

Type Description
httpx.Response

The response from the API.

Source code in tfl/clients/handlers/_lift_disruptions_handler.py
async def get_lift_disruptions(self) -> httpx.Response:
    """Get all current lift disruptions.

    Returns:
        The response from the API.
    """
    return await self.client.get(url="Disruptions/Lifts/v2")