Jump to content

NS (Nederlandse Spoorwegen) Train schedule for Alfred


Artemy

Recommended Posts

NS (Nederlandse Spoorwegen) Train schedule for Alfred

Alfred workflow for getting NS Train schedule.

image

Getting started

Prerequisites

Project requires Python 3.8+ to run, which is not included by default with macOS. You can install Python 3 using this guide.

 

⚠️ Make sure to get API key from https://apiportal.ns.nl/ and set it as workflow environment variable NS_APIKEY during the installation.

Downloading & Installing

Download NS_Schedule.alfredworkflow file from the latest release at this project's Github Releases page and open it with Alfred. Change the value of NS_APIKEY variable to the value you've received from NS at the Prerequisites step.

How to Use

Open Alfred and type ns and names of two train stations you want to see schedule for. Workflow will display list of upcoming trains for the route you have specified. Pressing Enter on a displayed item will open it on NS website, so you can get more details.

animation

Built With

Feedback & Contributions

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Link to comment

Welcome @Artemy,

 

19 minutes ago, Artemy said:

Project requires Python 3.8+ to run, which is not included by default with macOS. You can install Python 3 using this guide.

 

That is not necessary. You are just calling python3, so if the user doesn’t have it macOS will try to run /usr/bin/python3 which will show a GUI prompt to install the Developer Tools (which is done anyway when installing Homebrew) and it will then just work on consecutive runs. The version macOS adds is 3.8.9.

Link to comment
21 minutes ago, vitor said:

Welcome @Artemy,

 

 

That is not necessary. You are just calling python3, so if the user doesn’t have it macOS will try to run /usr/bin/python3 which will show a GUI prompt to install the Developer Tools (which is done anyway when installing Homebrew) and it will then just work on consecutive runs. The version macOS adds is 3.8.9.

thanks for the tip!

I thought about this when I upgraded the workflow to Python 3, but found explaining the dependency requirement in this way more reliable and honest.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...