pyfl package
Submodules
pyfl.accident module
pyfl.air module
pyfl.bikePoint module
- class bike
Bases:
objectbike class
- get_all_bike_points()
Returns all the bike points
- Returns
all the bike points in london.
- Return type
dict
- get_bike_point(id)
Returns a specfic bike point
- Parameters
id (int) – id of the bike point to get.
- Returns
the bike point.
- Return type
dict
- get_bike_point_by_name(name)
Returns a specfic bike point
- Parameters
name (str) – name of the bike point to get.
- Returns
the bike point.
- Return type
dict
pyfl.cabWise module
- class cab
Bases:
objectCab class
- get_taxi_information(lat, long, optype='', wheelchair=False, radius=0, name='', maxResults=20, legacyFormat=False, twentyFourSevenOnly=False)
Returns taxi and minicabs contact information
- Parameters
lat (float) – latitude
long (float) – longitude
optype (str) – Operator Type e.g Minicab, Executive, Limousine
wheelchair (bool) – Wheelchair accessible
radius (int) – The radius in metres to search for operators
name (str) – The trading name of the operating company
maxResults (int) – max results to search for, defualts to 20
legacyFormat (bool) – Legacy format [NOT RECOMMENDED], defualts to False
twentyFourSevenOnly (bool) – To only search for operators which are 24/7, defualts to False
- Returns
The taxi information.
- Return type
dict
pyfl.client module
- class client(api_key)
Bases:
object
pyfl.errors module
- exception PYFL_Error(message)
Bases:
ExceptionBase class for all PYFL errors.
- exception invalid_api_key(message)
Bases:
PYFL_ErrorRaised when the API key is invalid.
- exception invalid_endpoint(message)
Bases:
PYFL_ErrorRaised when the endpoint is invalid.
- exception invalid_parameter(message)
Bases:
PYFL_ErrorRaised when the parameter is invalid.
- exception invalid_response(message)
Bases:
PYFL_ErrorRaised when the response is invalid.
pyfl.helper module
pyfl.journeys module
- class journeys
Bases:
objectJourney class
- get_available_modes()
Get’s a list of all the available modes of transport
- Returns
The available modes of transport.
- Return type
dict
- perform_journey(fromcoord, tocoord)
” Perform a journey between two points, note: there are many more parameters that need to be added to this function at a later date. Please refer to the docs for more information (https://api.tfl.gov.uk/swagger/ui/index.html?url=/swagger/docs/v1#!/Journey/Journey_JourneyResults).
- Parameters
fromcoord (str) – The starting location
tocoord (str) – The destination
- Returns
The journey
- Return type
dict
pyfl.mode module
- class Mode
Bases:
objectMode class
- get_mode()
Returns the service type for a given mode
- Returns
The service type for a given mode.
- Return type
dict
- get_arrival_predictions(mode, count=-1)
Get’s the arrival predictions for all stops of a given mode
- Parameters
mode (str) – The mode to get the arrival predictions for.
count (int) – The number of arrivals to return, defaults to -1 (all)
- Returns
The arrival predictions.
- Return type
dict
pyfl.occupancy module
- class Occupancy
Bases:
objectOccupancy class
- get_car_park_occupancy(id='')
Returns the current occupancy of a car park
- Parameters
id (string) – The id of the car park, defualts to all
- Returns
The occupancy of the car park.
- Return type
dict
- get_charge_point_occupancy(id=[])
Returns the current occupancy of a charge point
- Parameters
id (array) – The id of the charge point, defualts to all
- Returns
The occupancy of the charge point.
- Return type
dict
- get_bike_point_occupancy(id)
Returns the current occupancy of a bike point
- Parameters
id (list) – The id of the bike point
- Returns
The occupancy of the bike point.
- Return type
dict
pyfl.place module
- class Place
Bases:
object- get_place_catagories()
Get all the place catagories
- Returns
The place catagories
- Return type
dict
- get_place_types()
Get all the place types
- Returns
The place types
- Return type
dict
- get_street(postcode)
Get the street for a given postcode
- Parameters
postcode (str) – The postcode to get the street for
- Returns
The street
- Return type
dict
- get_places_by_type(type=[], activeOnly=False)
Get all the places of a given type
- Parameters
type (list) – The type of place to get
activeOnly – Only return active places, defaults to False
- Returns
The places
- Return type
dict
- get_places_by_id(id)
Get a place by it’s id
- Parameters
id (str) – The id of the place
- Returns
The place
- Return type
dict
- get_places_by_location(radius, lat, long, type='', catagories=[], includeChildren=False, activeOnly=False, max=20)
Get all the places of a given type within a given radius of a given location
- Parameters
radius (int) – The radius to search in
lat (float) – The latitude of the location
long (float) – The longitude of the location
type (str) – The type of place to get (optional)
catagories (list) – The catagories of place to get (optional)
includeChildren (bool) – Include child places, defaults to False
activeOnly (bool) – Only return active places, defaults to False
max (int) – The maximum number of places to return, defaults to 20
- Returns
The places
- Return type
dict
- get_place_by_type_and_location(type, lat, long)
Get all the places of a given type within a given radius of a given location
- Parameters
type (list) – The type of place to get
lat (float) – The latitude of the location
long (float) – The longitude of the location
- Returns
The places
- Return type
dict
- get_place_by_type(name)
Get a place by it’s name
- Parameters
name (str) – The name of the place
- Returns
The place
- Return type
dict
- get_place_overlay(z, type, width, height, lat, long)
Get the overlay for a given place
- Parameters
z (int) – The zoom level
type (list) – The type of place to get
width (int) – The width of the overlay
height (int) – The height of the overlay
lat (int) – The latitude of the location
long (int) – The longitude of the location
- Returns
The overlay
- Return type
dict