parikstra

Parisian transport system API client
Download

parikstra Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Gawen Arab
  • Publisher web site:
  • http://gawen.me/

parikstra Tags


parikstra Description

parikstra is a Python module to calculate journey with the Parisian transport system, and read some other interesting data.It uses official API of Parisian transport websites, but is still an unofficial API client.It is at the moment in developpement. Use at your own risk.By the way, parikstra = Paris + DjikstraUsageInstall parikstra, either cloning this repositorygit clone git://github.com/Gawen/parikstra.gitor using pip (or other)pip install parikstraImport the parikstra moduleimport parikstraGet your departure pointdeparture = parikstra.Point("nation")Get your arrival pointarrival = parikstra.Point("dammartin juilly saint mard")Ask to calculate the itinerariesitineraries = departure.to(arrival)Print the itineraries' typefor i, itinerary in enumerate(itineraries): print "#%d. %s (duration %s)" % (i, itinerary.type, itinerary.duration, )Let's say you take the first oneitinerary = itinerariesRequest the itinerary's steps ...Iterate the different steps of the journeyfor i, step in enumerate(itinerary): print "#%d. %s => %s @ %s" % (i + 1, step.name, step.direction, step.time, )Here you go.CLIYou can use parikstra as a CLI client.Usage: parikstra.py Options: -h, --help show this help message and exit -d DEPARTURE, --departure=DEPARTURE Departure -a ARRIVAL, --arrival=ARRIVAL Arrival -v, --verbose VerbosifyExample:$ python parikstra.py --departure "nation" --arrival "aeroport charles de gaule"*** Itinerary #1 (2012-06-15 17:30:00 => 2012-06-15 18:11:00) - Type: Trajet arriv?e au plus t?t - Duration: 0:41:00 - Zones: *** Itinerary #2 (2012-06-15 17:33:00 => 2012-06-15 18:58:00) - Type: Trajet le moins de correspondances - Duration: 1:25:00 - Zones: Which one (1-2) ? 1********************************************************************************Itinerary Trajet arriv?e au plus t?t*** Steps1. Departure: NATION, Paris => GARE DE CERGY LE HAUT @ 17:30 - Line: RER A - UXOL2. CHATELET LES HALLES, Paris => CHATELET LES HALLES, Paris @ 17:35 - Walk duration: 0:02:00 - Wait duration: 0:04:003. CHATELET LES HALLES, Paris => CDG Terminal 2 / TGV @ 17:41 - Line: RER B - EMOI4. Arrival: AEROPORT CDG 1, Tremblay-en-France => AEROPORT CDG 1, Tremblay-en-France @ 18:11Product's homepage


parikstra Related Software