g冒险rest api的python客户端
gapip的Python项目详细描述
快速启动
>>>fromgapipyimportClient>>>api=Client(application_key='MY_SECRET_KEY')>>># Get a resource by id>>>tour=api.tours.get(24309)>>>tour.product_lineu'AHEH'>>>tour.departures.count()134>>>dossier=tour.tour_dossier>>>dossier.nameu'Essential India'>>>itinerary=dossier.structured_itineraries[0]>>>{day.day:day.summaryfordayinitinerary.days[:3]}{1:u'Arrive at any time. Arrival transfer included through the G Adventures-supported Women on Wheels project.',2:u'Take a morning walk through the city with a young adult from the G Adventures-supported New Delhi Streetkids Project. Later, visit Old Delhi, explore the spice markets, and visit Jama Masjid and Connaught Place.',3:u"Arrive in Jaipur and explore this gorgeous 'pink city'."}>>># Create a new resource>>>booking=api.bookings.create({'currency':'CAD','external_id':'abc'})>>># Modify an existing resource>>>booking.external_id='def'>>>booking.save()