https://github.com/artemy/alfred-ns-schedule
Alfred workflow for getting NS (Nederlandse Spoorwegen) train schedule.
https://github.com/artemy/alfred-ns-schedule
alfred alfred-workflow nederlandse-spoorwegen nederlandse-spoorwegen-api ns
Last synced: over 1 year ago
JSON representation
Alfred workflow for getting NS (Nederlandse Spoorwegen) train schedule.
- Host: GitHub
- URL: https://github.com/artemy/alfred-ns-schedule
- Owner: artemy
- License: mit
- Created: 2020-12-23T15:18:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-16T12:11:51.000Z (over 1 year ago)
- Last Synced: 2025-02-28T07:55:03.039Z (over 1 year ago)
- Topics: alfred, alfred-workflow, nederlandse-spoorwegen, nederlandse-spoorwegen-api, ns
- Language: Python
- Homepage:
- Size: 4 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# NS (Nederlandse Spoorwegen) Train schedule for Alfred 5


Alfred workflow for getting NS Train schedule.

## Getting started
⚠️ This workflow requires [Alfred 5](https://www.alfredapp.com/alfred-5-whats-new/).
Alfred 4 users can use [version 2.0](https://github.com/artemy/alfred-ns-schedule/releases/tag/v2.0) of the workflow.
### Prerequisites
Project requires Python 3.8+ to run, which is not included by default with macOS. You can install Python 3 using
this [guide](https://docs.python-guide.org/starting/install3/osx/).
⚠️ Make sure to get an API key from https://apiportal.ns.nl/ and set it in a user configuration of the workflow.
Subscribe to the product [NS-App](https://apiportal.ns.nl/product#product=NsApp).
### Installing
Download `NS_Schedule.alfred5workflow` file from the latest release
at [Releases](https://github.com/artemy/alfred-ns-schedule/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
1. Open Alfred
2. Type `ns` and the name of the origin station, confirm origin station choice by pressing "Enter"
3. Type the name of the destination station, confirm destination station choice by pressing "Enter".
Workflow will display a list of
upcoming trains for the route you have specified. Pressing `Enter` on a schedule item will open it on NS website in your default browser, where
you can get more details.

## Running the tests
Make sure to first install test dependencies:
```shell
pip3 install -r requirements.txt
```
To run tests, execute
```shell
python3 -m ns_schedule_test
```
If you want to get coverage figures through `coverage` tool:
```shell
coverage run -m unittest ns_schedule_test # gather test data
coverage report -m # display coverage figures
```
## Built With
* [Python 3.8](https://docs.python.org/3.8/)
* [GNU Make](https://www.gnu.org/software/make/manual/make.html) - Build scripting
* [coverage.py](https://coverage.readthedocs.io/) - Code coverage measurement
## Contributing
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](LICENSE.md) file for details
## Acknowledgments
See [Contributors](https://github.com/artemy/ns_schedule_test/contributors) for the list of contributors.