Skip to content

Commit

Permalink
Add example
Browse files Browse the repository at this point in the history
  • Loading branch information
fabaff committed Aug 23, 2017
1 parent 07eca8e commit dc206ac
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
Copyright (c) 2015-2017 Fabian Affolter <[email protected]>
Licensed under MIT. All rights reserved.
"""
from opendata_transport import OpendataTransport

data = OpendataTransport('Bern', 'Biel')

# Get the data
data.get_data()

# Print the start and the destination name
print("Train connections:", data.from_name, "->", data.to_name)

# Print the next three connections
print(data.connections)

# Print the details of the next connection
print(data.connections[0])

0 comments on commit dc206ac

Please sign in to comment.