wowair python api
wowair的Python项目详细描述
安装
运行以下命令以使用pip安装wowair
$ pip install wowair
用法:
fromwowairimportWowAirQuery,Currencyfromdatetimeimporttimedelta,date# Fetch available citiescities=WowAirQuery.get_cities()forcinsorted(cities,key=lambdacity:cities[city]):printcities[c],c# Fetch tickets for the next week from Montreal to Dublinquery=WowAirQuery(origin='YUL',destination='DUB')forticketinquery.get_tickets():printticket# Fetch Available tickets from New York to Anywhere in the NEXT 30 DAYSdepart_date_from=date.today()depart_date_to=depart_date_from+timedelta(days=30)query=WowAirQuery(origin='EWR',depart_date=(depart_date_from,depart_date_to),currency=Currency.USD)forticketinquery.get_tickets():ifticket.status=='Available':printticket