A module which allows you to retrieve the cheapest flights, with/out return flights, within a fixed set of dates.
Project description
Ryanair Python
This module allows you to retrieve the cheapest flights, with/out return flights, within a fixed set of dates.
This is done directly through Ryanair's API, and does not require an API key.
Installation
Run the following command in the terminal:
pip install ryanair-py
Initialisation
Creating an instance is done as follows:
from ryanair import Ryanair
ryanair = Ryanair("YOUR-CURRENCY")
Get one-way flights
flights = ryanair.getFlights("DUB", "2018-10-27", "2018-10-30")
Returns an array of Flight objects, like this:
flights[0] # Flight(origin='DUB', originFull='Dublin, Ireland', destination='MAN', destinationFull='Manchester, United Kingdom', departureTime='2018-10-30T06:25:00', price=9.78)
cheapestFlightPrice = flight.price # price is now a float containing the price (in the unit of currency originally declared earlier) of this flight
Get return flights
trips = ryanair.getReturnFlights("DUB", "2018-10-27", "2018-10-30", "2018-11-01", "2018-11-03")
Returns an array of Trip objects, like this:
trips[0] # Trip(outbound=Flight(origin='DUB', originFull='Dublin, Ireland', destination='LPL', destinationFull='Liverpool, United Kingdom', departureTime='2018-10-30T20:50:00', price=9.99), inbound=Flight(origin='LPL', originFull='Liverpool, United Kingdom', destination='DUB', destinationFull='Dublin, Ireland', departureTime='2018-11-01T08:25:00', price=18.51), totalPrice=28.5)
trips[0].outbound.price # 9.99
trips[0].totalPrice # 28.5
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ryanair-py-1.0.1.tar.gz
(3.0 MB
view hashes)
Built Distribution
Close
Hashes for ryanair_py-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64ac0e9ef42471fb5c48503b5befd726546f2e23a6c2ad43f7cd2913915ed774 |
|
MD5 | 98768f39d6ae5ac919092c25e0cdcff7 |
|
BLAKE2b-256 | b209fea09a53ab153037a4752e0588ddd7207d5ff749e09b3e0b39f2a4dc57f1 |