Skip to content

Accident

tubeulator.api.endpoint.routes.accident

Accessed via dynamic method resolution under tubeulator.fetch.accident_stats.

Example: tubeulator.fetch.accident_stats.year_accidents()

>>> accidents = fetch.accident_stats.year_accidents(year=2019)
>>> print(accidents[0].model_dump_json(indent=2))
{
  "Id": 345979,
  "Lat": 51.570865,
  "Lon": -0.231959,
  "Location": "On Edgware Road Near The Junction With north Circular Road",
  "Date": "2019-01-04T21:22:00Z",
  "Severity": "Slight",
  "Borough": "Barnet",
  "Casualties": [
    {
      "Age": 20,
      "Class": "Driver",
      "Severity": "Slight",
      "Mode": "PoweredTwoWheeler",
      "AgeBand": "Adult"
    }
  ],
  "Vehicles": [
    {
      "Type": "Motorcycle_500cc_Plus"
    },
    {
      "Type": "Car"
    }
  ]
}

AccidentStatsEndpointRoutes

Bases: RouteEnum

year_accidents class-attribute instance-attribute

year_accidents = '/{year}'

Gets all accident details for accidents occuring in the specified year