nsapi


Namensapi JSON
Version 3.1.2 PyPI version JSON
download
home_pageNone
Summaryapi wrapper for Dutch Railways (NS)
upload_time2024-11-24 18:00:08
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords api automation public transport
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =====
nsapi
=====

Query the Dutch railways about your routes, getting info on delays and
more. See below for the syntax and example output.

|PyPI version| |PyPI downloads| |PyPI license| |Code health| |Git version|

Installation
------------

From PyPI
~~~~~~~~~

Assuming you already are inside a virtualenv:

.. code-block:: bash

    pip install nsapi

From Git
~~~~~~~~

Create a new virtualenv (if you are not already in one) and install the
necessary packages:

.. code-block:: bash

    git clone https://github.com/aquatix/ns-api.git
    cd ns-api
    mkvirtualenv ns-api
    pip install -r requirements.txt

Development in Docker
~~~~~~~~~~~~~~~~~~~~~

Git clone this repository, use vscode & docker to remote open in a dev container
`as explained in this howto <https://code.visualstudio.com/docs/remote/containers>`_.

As part of ns-notifications
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Alternatively, follow the installation instructions of `ns-notifications`_,
which makes extensive use of this library to serve notifications to for
example a smartphone. The requirements of both packages can be installed
in the same ``ns-notifications`` one mentioned in the project;
``ns-api`` will be installed through pip from
`PyPI <https://pypi.python.org/pypi/nsapi>`__.

Home Assistant
~~~~~~~~~~~~~~

The very useful `Home Assistant <https://www.home-assistant.io/>`_ home automation software `includes an integration for the ns-api <https://www.home-assistant.io/integrations/nederlandse_spoorwegen/>`_. Be sure to check it out.

Also take a look at nsmaps
~~~~~~~~~~~~~~~~~~~~~~~~~~

Bart Römgens created `a fascinating contour map called nsmaps <https://github.com/bartromgens/nsmaps>`_ based on ns-api. It visualises Dutch railways travel information with OpenLayer 3 contour maps to show how long it takes to get somewhere in the Netherlands by train and bicycle.

Example application
-------------------

For example, I use the library to push notifications about my route to
my phone through `Pushbullet <http://pushbullet.com>`__. The program I
use to do this has its own repository: `ns-notifications`_.

NS API key
~~~~~~~~~~

To actually be able to query the `Nederlandse Spoorwegen
API <https://apiportal.ns.nl/>`_, you `need to subscribe
<https://apiportal.ns.nl/products/NsApp>`_. This immediately
gives you a primary and secundary key you need for access.

The library uses the `reisinformatie API <https://apiportal.ns.nl/docs/services/reisinformatie-api/>`_. Here you can try the API for yourself (and look up station names, but the library has the get_stations() function for this too).

The API portal also `provides statistics on usage and errors <https://apiportal.ns.nl/Developer/Analytics>`_.


.. |PyPI version| image:: https://img.shields.io/pypi/v/nsapi.svg
   :target: https://pypi.python.org/pypi/nsapi/
.. |PyPI downloads| image:: https://img.shields.io/pypi/dm/nsapi.svg
   :target: https://pypi.python.org/pypi/nsapi/
.. |PyPI license| image:: https://img.shields.io/github/license/aquatix/ns-api.svg
   :target: https://pypi.python.org/pypi/nsapi/
.. |Code health| image:: https://api.codacy.com/project/badge/Grade/84e8b4b9005b455c8977bb1d8dda2b64
   :target: https://www.codacy.com/manual/aquatix/ns-api?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=aquatix/ns-api&amp;utm_campaign=Badge_Grade
   :alt: Code Health
.. |Git version| image:: https://img.shields.io/github/commits-since/aquatix/ns-api/latest
   :target: https://github.com/aquatix/ns-api
   :alt: GitHub commits since latest release
.. _ns-notifications: https://github.com/aquatix/ns-notifications

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nsapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "api, automation, public transport",
    "author": null,
    "author_email": "Michiel Scholten <michiel@diginaut.net>",
    "download_url": "https://files.pythonhosted.org/packages/76/a3/1033128fe3ee644743ea47702aa3907cdf802bab94c71c3f49f0fd2e0288/nsapi-3.1.2.tar.gz",
    "platform": null,
    "description": "=====\nnsapi\n=====\n\nQuery the Dutch railways about your routes, getting info on delays and\nmore. See below for the syntax and example output.\n\n|PyPI version| |PyPI downloads| |PyPI license| |Code health| |Git version|\n\nInstallation\n------------\n\nFrom PyPI\n~~~~~~~~~\n\nAssuming you already are inside a virtualenv:\n\n.. code-block:: bash\n\n    pip install nsapi\n\nFrom Git\n~~~~~~~~\n\nCreate a new virtualenv (if you are not already in one) and install the\nnecessary packages:\n\n.. code-block:: bash\n\n    git clone https://github.com/aquatix/ns-api.git\n    cd ns-api\n    mkvirtualenv ns-api\n    pip install -r requirements.txt\n\nDevelopment in Docker\n~~~~~~~~~~~~~~~~~~~~~\n\nGit clone this repository, use vscode & docker to remote open in a dev container\n`as explained in this howto <https://code.visualstudio.com/docs/remote/containers>`_.\n\nAs part of ns-notifications\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAlternatively, follow the installation instructions of `ns-notifications`_,\nwhich makes extensive use of this library to serve notifications to for\nexample a smartphone. The requirements of both packages can be installed\nin the same ``ns-notifications`` one mentioned in the project;\n``ns-api`` will be installed through pip from\n`PyPI <https://pypi.python.org/pypi/nsapi>`__.\n\nHome Assistant\n~~~~~~~~~~~~~~\n\nThe very useful `Home Assistant <https://www.home-assistant.io/>`_ home automation software `includes an integration for the ns-api <https://www.home-assistant.io/integrations/nederlandse_spoorwegen/>`_. Be sure to check it out.\n\nAlso take a look at nsmaps\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nBart R\u00f6mgens created `a fascinating contour map called nsmaps <https://github.com/bartromgens/nsmaps>`_ based on ns-api. It visualises Dutch railways travel information with OpenLayer 3 contour maps to show how long it takes to get somewhere in the Netherlands by train and bicycle.\n\nExample application\n-------------------\n\nFor example, I use the library to push notifications about my route to\nmy phone through `Pushbullet <http://pushbullet.com>`__. The program I\nuse to do this has its own repository: `ns-notifications`_.\n\nNS API key\n~~~~~~~~~~\n\nTo actually be able to query the `Nederlandse Spoorwegen\nAPI <https://apiportal.ns.nl/>`_, you `need to subscribe\n<https://apiportal.ns.nl/products/NsApp>`_. This immediately\ngives you a primary and secundary key you need for access.\n\nThe library uses the `reisinformatie API <https://apiportal.ns.nl/docs/services/reisinformatie-api/>`_. Here you can try the API for yourself (and look up station names, but the library has the get_stations() function for this too).\n\nThe API portal also `provides statistics on usage and errors <https://apiportal.ns.nl/Developer/Analytics>`_.\n\n\n.. |PyPI version| image:: https://img.shields.io/pypi/v/nsapi.svg\n   :target: https://pypi.python.org/pypi/nsapi/\n.. |PyPI downloads| image:: https://img.shields.io/pypi/dm/nsapi.svg\n   :target: https://pypi.python.org/pypi/nsapi/\n.. |PyPI license| image:: https://img.shields.io/github/license/aquatix/ns-api.svg\n   :target: https://pypi.python.org/pypi/nsapi/\n.. |Code health| image:: https://api.codacy.com/project/badge/Grade/84e8b4b9005b455c8977bb1d8dda2b64\n   :target: https://www.codacy.com/manual/aquatix/ns-api?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=aquatix/ns-api&amp;utm_campaign=Badge_Grade\n   :alt: Code Health\n.. |Git version| image:: https://img.shields.io/github/commits-since/aquatix/ns-api/latest\n   :target: https://github.com/aquatix/ns-api\n   :alt: GitHub commits since latest release\n.. _ns-notifications: https://github.com/aquatix/ns-notifications\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "api wrapper for Dutch Railways (NS)",
    "version": "3.1.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/aquatix/ns-api/issues",
        "Homepage": "https://github.com/aquatix/ns-api/"
    },
    "split_keywords": [
        "api",
        " automation",
        " public transport"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "59d8baa2efe5e874b48e1eb27107bebd579fd1342522c08b57885051badd322d",
                "md5": "5e64586d298ee7123df1ce51167a198a",
                "sha256": "a9035c294e7aafcbf752928579fe5bac7f463c60483ee6cbd8a5db4a38be02a5"
            },
            "downloads": -1,
            "filename": "nsapi-3.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5e64586d298ee7123df1ce51167a198a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10682,
            "upload_time": "2024-11-24T18:00:05",
            "upload_time_iso_8601": "2024-11-24T18:00:05.708665Z",
            "url": "https://files.pythonhosted.org/packages/59/d8/baa2efe5e874b48e1eb27107bebd579fd1342522c08b57885051badd322d/nsapi-3.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "76a31033128fe3ee644743ea47702aa3907cdf802bab94c71c3f49f0fd2e0288",
                "md5": "1c8b90e0f3b52a5fee57bbfed8b14b8f",
                "sha256": "b68ec88bd142199aa8faaeaff318c18369242d3432ebb3d36eb554cbbdc24da3"
            },
            "downloads": -1,
            "filename": "nsapi-3.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "1c8b90e0f3b52a5fee57bbfed8b14b8f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 13018,
            "upload_time": "2024-11-24T18:00:08",
            "upload_time_iso_8601": "2024-11-24T18:00:08.011627Z",
            "url": "https://files.pythonhosted.org/packages/76/a3/1033128fe3ee644743ea47702aa3907cdf802bab94c71c3f49f0fd2e0288/nsapi-3.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-24 18:00:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aquatix",
    "github_project": "ns-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "tox": true,
    "lcname": "nsapi"
}
        
Elapsed time: 1.02967s