woob.capabilities.travel

class woob.capabilities.travel.CapTravel

Bases: woob.capabilities.base.Capability

Travel websites.

iter_roadmap(departure, arrival, filters)

Get a roadmap.

Parameters
  • departure (str) – name of departure station

  • arrival (str) – name of arrival station

  • filters (RoadmapFilters) – filters on search

Return type

iter[RoadStep]

iter_station_departures(station_id, arrival_id=None, date=None)

Iterate on departures.

Parameters
  • station_id (str) – the station ID

  • arrival_id (str) – optionnal arrival station ID

  • date (datetime.datetime) – optional date

Return type

iter[Departure]

Iterates on search results of stations.

Parameters

pattern (str) – the search pattern

Return type

iter[Station]

class woob.capabilities.travel.Departure(id=None, _type=None, _time=None, url=None)

Bases: woob.capabilities.base.BaseObject

Describes a departure.

Variables
  • type – (str) Type of train

  • time – (time, datetime) Departure time

  • departure_station – (str) Departure station

  • arrival_station – (str) Destination of the train

  • arrival_time – (time, datetime) Arrival time

  • late – (time, datetime) Optional late (default: 00:00:00)

  • information – (str) Informations

  • plateform – (str) Where the train will leave

  • price – (Decimal) Price of ticket

  • currency – (str) Currency (default: None)

class woob.capabilities.travel.RoadStep(id='', url=NotLoaded, backend=None)

Bases: woob.capabilities.base.BaseObject

A step on a roadmap.

Variables
  • line – (str) When line

  • start_time – (time, datetime) Start of step

  • end_time – (time, datetime) End of step

  • departure – (str) Departure station

  • arrival – (str) Arrival station

  • duration – (timedelta) Duration of this step

exception woob.capabilities.travel.RoadmapError

Bases: woob.capabilities.base.UserError

Raised when the roadmap is unable to be calculated.

class woob.capabilities.travel.RoadmapFilters(id='', url=None)

Bases: woob.capabilities.base.BaseObject

Filters to get a roadmap.

Variables
  • departure_time – (date, datetime) Wanted departure time

  • arrival_time – (date, datetime) Wanted arrival time

class woob.capabilities.travel.Station(id=None, name=None, url=None)

Bases: woob.capabilities.base.BaseObject

Describes a station.

Variables

name – (str) Name of station