weboob.capabilities.travel

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

Bases: weboob.capabilities.base.BaseObject

Describes a station.
Variables:name – (unicode) Name of station
class weboob.capabilities.travel.Departure(id=None, _type=None, _time=None, url=None)

Bases: weboob.capabilities.base.BaseObject

Describes a departure.
Variables:
  • type – (unicode) Type of train
  • time – (time, datetime) Departure time
  • departure_station – (unicode) Departure station
  • arrival_station – (unicode) Destination of the train
  • arrival_time – (time, datetime) Arrival time
  • late – (time, datetime) Optional late (default: 00:00:00)
  • information – (unicode) Informations
  • plateform – (unicode) Where the train will leave
  • price – (Decimal) Price of ticket
  • currency – (unicode) Currency (default: None)
class weboob.capabilities.travel.RoadStep(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.base.BaseObject

A step on a roadmap.
Variables:
  • line – (unicode) When line
  • start_time – (time, datetime) Start of step
  • end_time – (time, datetime) End of step
  • departure – (unicode) Departure station
  • arrival – (unicode) Arrival station
  • duration – (timedelta) Duration of this step
exception weboob.capabilities.travel.RoadmapError

Bases: weboob.capabilities.base.UserError

Raised when the roadmap is unable to be calculated.

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

Bases: weboob.capabilities.base.BaseObject

Filters to get a roadmap.
Variables:
  • departure_time – (date, datetime) Wanted departure time
  • arrival_time – (date, datetime) Wanted arrival time
class weboob.capabilities.travel.CapTravel

Bases: weboob.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]