/ns-api-python

Simple Python wrapper of the NS API

Primary LanguagePython

Python NS API

mypy pytest lint

This project serves as a simple Python client of the NS API. The reponses are stored in Pydantic models, enabling easy manipulation and validation of the data.

Setup

Get a (free) API key from NS (see the startersguide).

Create a file called .env with the following content: (see sample.env)

API_KEY="<api key>"

Usage

Run python3 main.py --help to see a list of commands.

It is recommended to first run python3 main.py stations to retrieve (and store) a list of all stations.