Skip to content
/ nslib Public

Full-featured library for the dutch railways (NS).

License

Notifications You must be signed in to change notification settings

boltgolt/nslib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nslib

Library to interact with the Dutch Railways (Nederlandse Spoorwegen).

Usage

# Initialize nslib
ns = NsAPI()

# Current and planned disruptions on the rail network
ns.disruptions

# Get departing trains from a station
ns.getDepartures("RTB")
# Get route options between 2 to 3 points
ns.getRoute(["LC", "MG", "RTB"])

# Log into a NS account
account = ns.Account("email", "password")

for card in account.cards:
	# OV-Chipcard number
	card.number
	# Whether or not the card is currently checked in
	card.checkedIn
	# Last known account balance
	card.balance
	# Last known trips
	card.trips

The official station codes have to be used for getDepartures and getRoute , the full list of codes can be found here.

About

Full-featured library for the dutch railways (NS).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages