From 8ba60dcf92d14133246ae9fbfc59673f2ee7ebb8 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Thu, 28 Jan 2021 14:21:36 +0100 Subject: [PATCH] =?UTF-8?q?improve=20readme.md=20&=20p/readme.md=20?= =?UTF-8?q?=F0=9F=93=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - more list of profiles to p/readme.md - explain related libs better - tweak readme.md section for better readability [ci skip] --- p/readme.md | 62 ++++++++++++++++++++++++++---- readme.md | 106 +++++++++++++++++++--------------------------------- 2 files changed, 92 insertions(+), 76 deletions(-) diff --git a/p/readme.md b/p/readme.md index fa6630a9..aa4a0cc6 100644 --- a/p/readme.md +++ b/p/readme.md @@ -1,17 +1,63 @@ -# Profiles +# `hafas-client` profiles -This directory contains specific customisations for each endpoint, called *profiles*. They **parse data from the API differently, add additional information, or enable non-default methods** (such as [`trip`](../docs/trip.md)) if they are supported. +This directory contains specific customisations for each endpoint, called *profiles*. They **parse data from the API differently, add additional information, or add special methods specific to the endpoint** (such as [`journeysFromTrip`](https://github.com/public-transport/hafas-client/blob/453f4b0e1005ecb85569e1bd08096ed4c77f4184/docs/journeys-from-trip.md)). -Each profile has it's own directory. It will be passed into `hafas-client` and is expected to be in a certain structure: +## built-in profiles + +There are built-in profiles for these public transportation networks: + +HAFAS endpoint | wrapper library | docs | example code | source code +-|-|-|-|- +[Deutsche Bahn (DB)](https://en.wikipedia.org/wiki/Deutsche_Bahn) | [`db-hafas`](https://github.com/public-transport/db-hafas) | [docs](db/readme.md) | [example](db/example.js) | [src](db/index.js) +[Swiss Railways (SBB)](https://en.wikipedia.org/wiki/Swiss_Federal_Railways) | - | [docs](sbb/readme.md) | [example](sbb/example.js) | [src](sbb/index.js) +[Polskie Koleje Państwowe (PKP)](https://en.wikipedia.org/wiki/Polish_State_Railways) | [`pkp-hafas`](https://github.com/juliuste/pkp-hafas) | [docs](pkreadme.md) | [example](pkexample.js) | [src](pkindex.js) +[Belgian National Railways (SNCB/NMBS)](https://en.wikipedia.org/wiki/National_Railway_Company_of_Belgium) | - | [docs](sncb/readme.md) | [example](sncb/example.js) | [src](sncb/index.js) +[*Iarnród Éireann* (Irish Rail)](https://en.wikipedia.org/wiki/Iarnród_Éireann) | - | [docs](irish-rail/readme.md) | [example](irish-rail/example.js) | [src](irish-rail/index.js) +[Berlin & Brandenburg public transport (VBB)](https://en.wikipedia.org/wiki/Verkehrsverbund_Berlin-Brandenburg) | [`vbb-hafas`](https://github.com/public-transport/vbb-hafas) | [docs](vbb/readme.md) | [example](vbb/example.js) | [src](vbb/index.js) +[Berlin public transport (BVG)](https://en.wikipedia.org/wiki/Berliner_Verkehrsbetriebe) | [`bvg-hafas`](https://github.com/public-transport/bvg-hafas) | [docs](bvg/readme.md) | [example](bvg/example.js) | [src](bvg/index.js) +[Österreichische Bundesbahnen (ÖBB)](https://en.wikipedia.org/wiki/Austrian_Federal_Railways) | [`oebb-hafas`](https://github.com/juliuste/oebb-hafas) | [docs](oebb/readme.md) | [example](oebb/example.js) | [src](oebb/index.js) +[*Mobilitéitszentral* (Luxembourg)](https://www.mobiliteit.lu/) | - | [docs](mobiliteit-lu/readme.md) | [example](mobiliteit-lu/example.js) | [src](mobiliteit-lu/index.js) +[Bay Area Rapid Transit (BART)](https://en.wikipedia.org/wiki/Bay_Area_Rapid_Transit) | [docs](bart/readme.md) | [example](bart/example.js) | [src](bart/index.js) +[Nahverkehr Sachsen-Anhalt (NASA)](https://de.wikipedia.org/wiki/Nahverkehrsservice_Sachsen-Anhalt)/[INSA](https://insa.de) | [`insa-hafas`](https://github.com/public-transport/insa-hafas) | [docs](insa/readme.md) | [example](insa/example.js) | [src](insa/index.js) +[Nahverkehrsverbund Schleswig-Holstein (NAH.SH)](https://de.wikipedia.org/wiki/Nahverkehrsverbund_Schleswig-Holstein) | [`nahsh-hafas`](https://github.com/juliuste/nahsh-hafas) | [docs](nahsh/readme.md) | [example](nahsh/example.js) | [src](nahsh/index.js) +[Rhein-Main-Verkehrsverbund (RMV)](https://en.wikipedia.org/wiki/Rhein-Main-Verkehrsverbund) | - | [docs](rmv/readme.md) | [example](rmv/example.js) | [src](rmv/index.js) +[Austin, Texas (CMTA/*CapMetro*)](https://en.wikipedia.org/wiki/Capital_Metropolitan_Transportation_Authority) | - | [docs](cmta/readme.md) | [example](cmta/example.js) | [src](cmta/index.js) +[*S-Bahn München*](https://en.wikipedia.org/wiki/Munich_S-Bahn) | - | [docs](sbahn-muenchen/readme.md) | [example](sbahn-muenchen/example.js) | [src](sbahn-muenchen/index.js) +*Saarfahrplan*/VGS ([Saarland](https://en.wikipedia.org/wiki/Saarland)) | - | [docs](saarfahrplan/readme.md) | [example](saarfahrplan/example.js) | [src](saarfahrplan/index.js) +[Société Nationale des Chemins de Fer Luxembourgeois (CFL)](https://en.wikipedia.org/wiki/Société_Nationale_des_Chemins_de_Fer_Luxembourgeois) | - | [docs](cfl/readme.md) | [example](cfl/example.js) | [src](cfl/index.js) +[Hamburg public transport (HVV)](https://en.wikipedia.org/wiki/Hamburger_Verkehrsverbund) | - | [docs](hvv/readme.md) | [example](hvv/example.js) | [src](hvv/index.js) +[*Nordhessischer Verkehrsverbund (NVV)*](https://en.wikipedia.org/wiki/Nordhessischer_Verkehrsverbund) ([Hesse](https://en.wikipedia.org/wiki/Hesse)) | - | [docs](nvv/readme.md) | [example](nvv/example.js) | [src](nvv/index.js) +[*mobil.nrw*](https://www.mobil.nrw) | - | [docs](mobil-nrw/readme.md) | [example](mobil-nrw/example.js) | [src](mobil-nrw/index.js) +*DB Busradar NRW* ([DB Regio Bus](https://en.wikipedia.org/wiki/DB_Regio#Bus_division_(DB_Regio_Bus))) | - | [docs](db-busradar-nrw/readme.md) | [example](db-busradar-nrw/example.js) | [src](db-busradar-nrw/index.js) +[Verkehrsverbund Süd-Niedersachsen (VSN)](https://de.wikipedia.org/wiki/Verkehrsverbund_S%C3%BCd-Niedersachsen) | - | [docs](vsn/readme.md) | [example](vsn/example.js) | [src](vsn/index.js) +[Ingolstädter Verkehrsgesellschaft (INVG)](https://de.wikipedia.org/wiki/Ingolstädter_Verkehrsgesellschaft) | - | [docs](invg/readme.md) | [example](invg/example.js) | [src](invg/index.js) +[Verkehrsverbund Bremen/Niedersachsen (VBN)](https://de.wikipedia.org/wiki/Verkehrsverbund_Bremen/Niedersachsen) | - | [docs](vbn/readme.md) | [example](vbn/example.js) | [src](vbn/index.js) +[Verkehrsverbund Rhein-Neckar (VRN)](https://en.wikipedia.org/wiki/Verkehrsverbund_Rhein-Neckar) | - | [docs](vrn/readme.md) | [example](vrn/example.js) | [src](vrn/index.js) +[Rostocker Straßenbahn AG (RSAG)](https://de.wikipedia.org/wiki/Rostocker_Straßenbahn_AG) | - | [docs](rsag/readme.md) | [example](rsag/example.js) | [src](rsag/index.js) +[Verkehrsverbund Mittelthüringen (VMT)](https://en.wikipedia.org/wiki/Verkehrsverbund_Mittelthüringen) | - | [docs](vmt/readme.md) | [example](vmt/example.js) | [src](vmt/index.js) +[Verkehrsgemeinschaft Osnabrück (VOS)](https://de.wikipedia.org/wiki/Verkehrsgemeinschaft_Osnabrück) | - | [docs](vos/readme.md) | [example](vos/example.js) | [src](vos/index.js) +[Aachener Verkehrsverbund (AVV)](https://de.wikipedia.org/wiki/Verkehrsgemeinschaft_Osnabrück) | - | [docs](avv/readme.md) | [example](avv/example.js) | [src](avv/index.js) +[Salzburg public transport (SVV)](https://de.wikipedia.org/wiki/Salzburger_Verkehrsverbund) | - | [docs](svv/readme.md) | [example](svv/example.js) | [src](svv/index.js) +[Verkehrsverbund Tirol (VVT)](https://de.wikipedia.org/wiki/Verkehrsverbund_Tirol) | - | [docs](vvt/readme.md) | [example](vvt/example.js) | [src](vvt/index.js) +[*Kärntner Linien/Verkehrsverbund Kärnten (VKG/VVK)*](https://de.wikipedia.org/wiki/Verkehrsverbund_Kärnten) | - | [docs](vkg/readme.md) | [example](vkg/example.js) | [src](vkg/index.js) +[Zürich public transport (ZVV)](https://en.wikipedia.org/wiki/Zürcher_Verkehrsverbund) | - | [docs](zvv/readme.md) | [example](zvv/example.js) | [src](zvv/index.js) + +## writing your own + +If you want to write a profile for an endpoint, check out the [*writing a profile* guide](../docs/writing-a-profile.md). + +Your profile must be passed into `createClient` and is expected to be in a certain structure: ```js const createClient = require('hafas-client') -const someProfile = require('hafas-client/p/some-profile') + +const myCustomProfile = { + // … +} // create a client with the profile -const client = createClient(dbProfile) +const client = createClient(myCustomProfile) -// use it to query data… +// use it to query data +await client.journeys('1234', '2345') ``` - -If you want to write a profile for an endpoint, check out the [*writing a profile* guide](../docs/writing-a-profile.md). diff --git a/readme.md b/readme.md index c0ea5dfb..576a3f39 100644 --- a/readme.md +++ b/readme.md @@ -11,13 +11,24 @@ ## Background -[A company called HaCon](https://hacon.de) sells [a public transport management system called HAFAS](https://de.wikipedia.org/wiki/HAFAS). It is [used by public transport providers across Europe](https://gist.github.com/derhuerst/2b7ed83bfa5f115125a5) to provide routing and departure information to their customers. +[A company called HaCon](https://hacon.de) sells [a public transport management system called HAFAS](https://de.wikipedia.org/wiki/HAFAS) to public transport authorities and providers, mostly in Europe. It provides routing and departure information to their customers. -Most customers get their own, **separate HAFAS deployments**; They all use the same terminology and API calls, but have slightly different versions, configurations and sets of enabled features. Using [endpoint-specific customisations that we call *profiles*](p), **`hafas-client` abstracts most of these differences away, and supports additional features in some cases**. Check the [*supported networks/endpoints* list](#supported-networksendpoints) for more info. +Most customers get their own, **separate HAFAS deployments**; They all use the same terminology and API calls, but have slightly different versions, configurations and sets of enabled features. Using [built-in endpoint-specific customisations](p/readme.md), **`hafas-client` abstracts most of these differences away, and supports additional features in some cases**. Check the [list of supported networks/endpoints](p/readme.md#built-in-profiles) for more info. *Note:* Currently, **`hafas-client` only supports "mobile API" endpoints**, which are designed for and used by the respective official mobile app(s); These endpoints almost always have `mgate.exe` in the URL. This library *does not* support "open API" endpoints (often they have `rest-proxy` or `openapi` in the URL) yet, but [#134](https://github.com/public-transport/hafas-client/pull/134) contains work in progress. -Strictly speaking, permission is necessary to use `hafas-client` with a HAFAS "mobile" endpoint. It merely tries to remove the *technical* barrier of accessing the data, in order to kick-start an ecosystem or apps and services that would eventually rely on [*openly available* data](https://opendatahandbook.org/solutions/en/Public-Transport-Data/). +Strictly speaking, permission is necessary to use this library with a HAFAS "mobile" endpoint. It merely tries to remove the *technical* barrier of accessing the data, in order to kick-start an ecosystem or apps and services that will eventually rely on [*openly available* data](https://opendatahandbook.org/solutions/en/Public-Transport-Data/). + + +## supported networks/endpoints + +`hafas-client` has [built-in support for many public transportation networks](p/readme.md). + +There are also libraries that use `hafas-client` and pass their own profile in: + +HAFAS endpoint | library +---------------|-------- +[Betriebsstellen & disturbances in the German rail network](https://strecken.info/) | [`db-netz-hafas`](https://github.com/derhuerst/db-netz-hafas) ## Installing @@ -31,14 +42,9 @@ npm install hafas-client `hafas-client` as well its dependencies use [Node-builtin modules](https://nodejs.org/dist/latest/docs/api/) and [Node globals](https://nodejs.org/api/globals.html). To be able to use it within react-native, follow [the instructions at `node-libs-react-native`](https://github.com/parshap/node-libs-react-native/blob/master/README.md#usage). -## API - -[API documentation](docs/readme.md) - - ## Usage -Pick the [profile](p) for a HAFAS endpoint that covers the area you want to get data for. Pass the profile and an expressive name for your program into the `createClient` entry point of this library: +Pick the [profile](p/readme.md) for the HAFAS endpoint covering the area you want to get data for. Pass the profile and a descriptive name for your program into the `createClient` function: ```js const createClient = require('hafas-client') @@ -48,12 +54,12 @@ const dbProfile = require('hafas-client/p/db') const client = createClient(dbProfile, 'my-awesome-program') ``` -You can now use the `client` object to query the HAFAS endpoint configured in the [`db` profile](p/db): +You can now use `client` to query the HAFAS endpoint configured in the [`db` profile](p/db): ```js // Berlin Jungfernheide to München Hbf -client.journeys('8011167', '8000261', {results: 1}) -.then(console.log).catch(console.error) +const res = await client.journeys('8011167', '8000261', {results: 1}) +console.log(res) ``` `journeys()` returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/promise) that will resolve with an object with an array `journeys` that contains one [*Friendly Public Transport Format* (*FPTF*) `1.2.1` `journey`](https://github.com/public-transport/friendly-public-transport-format/blob/1.2.1/spec/readme.md#journey). @@ -125,7 +131,7 @@ client.journeys('8011167', '8000261', {results: 1}) type: 'station', id: '8089118', name: 'Berlin Beusselstraße' - /* … */ + // … }, arrival: '2017-12-19T17:08:00+01:00', plannedArrival: '2017-12-19T17:08:00+01:00', @@ -142,7 +148,7 @@ client.journeys('8011167', '8000261', {results: 1}) type: 'station', id: '730749', name: 'Berlin Hauptbahnhof (S+U), Berlin' - /* … */ + // … }, plannedDeparture: '2017-12-19T17:25:00+01:00', prognosedDeparture: null, @@ -152,7 +158,7 @@ client.journeys('8011167', '8000261', {results: 1}) type: 'station', id: '8098160', name: 'Berlin Hbf (tief)' - /* … */ + // … }, arrival: '2017-12-19T17:33:00+01:00', plannedArrival: '2017-12-19T17:33:00+01:00', @@ -166,7 +172,7 @@ client.journeys('8011167', '8000261', {results: 1}) type: 'station', id: '8098160', name: 'Berlin Hbf (tief)' - /* … */ + // … }, departure: '2017-12-19T17:35:00+01:00', plannedDeparture: '2017-12-19T17:37:00+01:00', @@ -178,7 +184,7 @@ client.journeys('8011167', '8000261', {results: 1}) type: 'station', id: '8000261', name: 'München Hbf', - /* … */ + // … }, arrival: '2017-12-19T22:44:00+01:00', plannedArrival: '2017-12-19T22:45:00+01:00', @@ -190,69 +196,31 @@ client.journeys('8011167', '8000261', {results: 1}) amount: null, hint: 'No pricing information available.' } - /* … */ + // … } ] - /* … */ + // … } ``` -Each of the [profiles](p) has more detailed example code. +Each [profile](p/readme.md) has more detailed example code. + +### in the browser + +While `hafas-client` itself should work in the browser via a bundler like [Webpack](https://webpack.js.org), most HAFAS API endpoints don't enable [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), so you won't be able query them directly. -## supported networks/endpoints +## API -`hafas-client` has [built-in customisations called *profiles*](p) for these public transportation networks: - -HAFAS endpoint | wrapper library | docs | example code | source code ----------------|------------------|------|---------|------------ -[Deutsche Bahn (DB)](https://en.wikipedia.org/wiki/Deutsche_Bahn) | [`db-hafas`](https://github.com/public-transport/db-hafas) | [docs](p/db/readme.md) | [example code](p/db/example.js) | [src](p/db/index.js) -[Swiss Railways (SBB)](https://en.wikipedia.org/wiki/Swiss_Federal_Railways) | - | [docs](p/sbb/readme.md) | [example code](p/sbb/example.js) | [src](p/sbb/index.js) -[Polskie Koleje Państwowe (PKP)](https://en.wikipedia.org/wiki/Polish_State_Railways) | [`pkp-hafas`](https://github.com/juliuste/pkp-hafas) | [docs](p/pkp/readme.md) | [example code](p/pkp/example.js) | [src](p/pkp/index.js) -[Belgian National Railways (SNCB/NMBS)](https://en.wikipedia.org/wiki/National_Railway_Company_of_Belgium) | - | [docs](p/sncb/readme.md) | [example code](p/sncb/example.js) | [src](p/sncb/index.js) -[*Iarnród Éireann* (Irish Rail)](https://en.wikipedia.org/wiki/Iarnród_Éireann) | - | [docs](p/irish-rail/readme.md) | [example code](p/irish-rail/example.js) | [src](p/irish-rail/index.js) -[Berlin & Brandenburg public transport (VBB)](https://en.wikipedia.org/wiki/Verkehrsverbund_Berlin-Brandenburg) | [`vbb-hafas`](https://github.com/public-transport/vbb-hafas) | [docs](p/vbb/readme.md) | [example code](p/vbb/example.js) | [src](p/vbb/index.js) -[Berlin public transport (BVG)](https://en.wikipedia.org/wiki/Berliner_Verkehrsbetriebe) | [`bvg-hafas`](https://github.com/public-transport/bvg-hafas) | [docs](p/bvg/readme.md) | [example code](p/bvg/example.js) | [src](p/bvg/index.js) -[Österreichische Bundesbahnen (ÖBB)](https://en.wikipedia.org/wiki/Austrian_Federal_Railways) | [`oebb-hafas`](https://github.com/juliuste/oebb-hafas) | [docs](p/oebb/readme.md) | [example code](p/oebb/example.js) | [src](p/oebb/index.js) -[*Mobilitéitszentral* (Luxembourg)](https://www.mobiliteit.lu/) | - | [docs](p/mobiliteit-lu/readme.md) | [example code](p/mobiliteit-lu/example.js) | [src](p/mobiliteit-lu/index.js) -[Bay Area Rapid Transit (BART)](https://en.wikipedia.org/wiki/Bay_Area_Rapid_Transit) | [docs](p/bart/readme.md) | [example code](p/bart/example.js) | [src](p/bart/index.js) -[Nahverkehr Sachsen-Anhalt (NASA)](https://de.wikipedia.org/wiki/Nahverkehrsservice_Sachsen-Anhalt)/[INSA](https://insa.de) | [`insa-hafas`](https://github.com/public-transport/insa-hafas) | [docs](p/insa/readme.md) | [example code](p/insa/example.js) | [src](p/insa/index.js) -[Nahverkehrsverbund Schleswig-Holstein (NAH.SH)](https://de.wikipedia.org/wiki/Nahverkehrsverbund_Schleswig-Holstein) | [`nahsh-hafas`](https://github.com/juliuste/nahsh-hafas) | [docs](p/nahsh/readme.md) | [example code](p/nahsh/example.js) | [src](p/nahsh/index.js) -[Rhein-Main-Verkehrsverbund (RMV)](https://en.wikipedia.org/wiki/Rhein-Main-Verkehrsverbund) | - | [docs](p/rmv/readme.md) | [example code](p/rmv/example.js) | [src](p/rmv/index.js) -[Austin, Texas (CMTA/*CapMetro*)](https://en.wikipedia.org/wiki/Capital_Metropolitan_Transportation_Authority) | - | [docs](p/cmta/readme.md) | [example code](p/cmta/example.js) | [src](p/cmta/index.js) -[*S-Bahn München*](https://en.wikipedia.org/wiki/Munich_S-Bahn) | - | [docs](p/sbahn-muenchen/readme.md) | [example code](p/sbahn-muenchen/example.js) | [src](p/sbahn-muenchen/index.js) -*Saarfahrplan*/VGS ([Saarland](https://en.wikipedia.org/wiki/Saarland)) | - | [docs](p/saarfahrplan/readme.md) | [example code](p/saarfahrplan/example.js) | [src](p/saarfahrplan/index.js) -[Société Nationale des Chemins de Fer Luxembourgeois (CFL)](https://en.wikipedia.org/wiki/Société_Nationale_des_Chemins_de_Fer_Luxembourgeois) | - | [docs](p/cfl/readme.md) | [example code](p/cfl/example.js) | [src](p/cfl/index.js) -[Hamburg public transport (HVV)](https://en.wikipedia.org/wiki/Hamburger_Verkehrsverbund) | - | [docs](p/hvv/readme.md) | [example code](p/hvv/example.js) | [src](p/hvv/index.js) -[*Nordhessischer Verkehrsverbund (NVV)*](https://en.wikipedia.org/wiki/Nordhessischer_Verkehrsverbund) ([Hesse](https://en.wikipedia.org/wiki/Hesse)) | - | [docs](p/nvv/readme.md) | [example code](p/nvv/example.js) | [src](p/nvv/index.js) -[*mobil.nrw*](https://www.mobil.nrw) | - | [docs](p/mobil-nrw/readme.md) | [example code](p/mobil-nrw/example.js) | [src](p/mobil-nrw/index.js) -*DB Busradar NRW* ([DB Regio Bus](https://en.wikipedia.org/wiki/DB_Regio#Bus_division_(DB_Regio_Bus))) | - | [docs](p/db-busradar-nrw/readme.md) | [example code](p/db-busradar-nrw/example.js) | [src](p/db-busradar-nrw/index.js) -[Verkehrsverbund Süd-Niedersachsen (VSN)](https://de.wikipedia.org/wiki/Verkehrsverbund_S%C3%BCd-Niedersachsen) | - | [docs](p/vsn/readme.md) | [example code](p/vsn/example.js) | [src](p/vsn/index.js) -[Ingolstädter Verkehrsgesellschaft (INVG)](https://de.wikipedia.org/wiki/Ingolstädter_Verkehrsgesellschaft) | - | [docs](p/invg/readme.md) | [example code](p/invg/example.js) | [src](p/invg/index.js) -[Verkehrsverbund Bremen/Niedersachsen (VBN)](https://de.wikipedia.org/wiki/Verkehrsverbund_Bremen/Niedersachsen) | - | [docs](p/vbn/readme.md) | [example code](p/vbn/example.js) | [src](p/vbn/index.js) -[Verkehrsverbund Rhein-Neckar (VRN)](https://en.wikipedia.org/wiki/Verkehrsverbund_Rhein-Neckar) | - | [docs](p/vrn/readme.md) | [example code](p/vrn/example.js) | [src](p/vrn/index.js) -[Rostocker Straßenbahn AG (RSAG)](https://de.wikipedia.org/wiki/Rostocker_Straßenbahn_AG) | - | [docs](p/rsag/readme.md) | [example code](p/rsag/example.js) | [src](p/rsag/index.js) -[Verkehrsverbund Mittelthüringen (VMT)](https://en.wikipedia.org/wiki/Verkehrsverbund_Mittelthüringen) | - | [docs](p/vmt/readme.md) | [example code](p/vmt/example.js) | [src](p/vmt/index.js) -[Verkehrsgemeinschaft Osnabrück (VOS)](https://de.wikipedia.org/wiki/Verkehrsgemeinschaft_Osnabrück) | - | [docs](p/vos/readme.md) | [example code](p/vos/example.js) | [src](p/vos/index.js) -[Aachener Verkehrsverbund (AVV)](https://de.wikipedia.org/wiki/Verkehrsgemeinschaft_Osnabrück) | - | [docs](p/avv/readme.md) | [example code](p/avv/example.js) | [src](p/avv/index.js) -[Salzburg public transport (SVV)](https://de.wikipedia.org/wiki/Salzburger_Verkehrsverbund) | - | [docs](p/svv/readme.md) | [example code](p/svv/example.js) | [src](p/svv/index.js) -[Verkehrsverbund Tirol (VVT)](https://de.wikipedia.org/wiki/Verkehrsverbund_Tirol) | - | [docs](p/vvt/readme.md) | [example code](p/vvt/example.js) | [src](p/vvt/index.js) -[*Kärntner Linien/Verkehrsverbund Kärnten (VKG/VVK)*](https://de.wikipedia.org/wiki/Verkehrsverbund_Kärnten) | - | [docs](p/vkg/readme.md) | [example code](p/vkg/example.js) | [src](p/vkg/index.js) -[Zürich public transport (ZVV)](https://en.wikipedia.org/wiki/Zürcher_Verkehrsverbund) | - | [docs](p/zvv/readme.md) | [example code](p/zvv/example.js) | [src](p/zvv/index.js) - -There are also libraries that use `hafas-client` and pass their own profile in: - -HAFAS endpoint | library ----------------|-------- -[Betriebsstellen & disturbances in the German rail network](https://strecken.info/) | [`db-netz-hafas`](https://github.com/derhuerst/db-netz-hafas) +[API documentation](docs/readme.md) ## Related - [`*.transport.rest`](https://transport.rest/) – Public APIs wrapping some HAFAS endpoints. - [`BahnhofsAbfahrten`](https://github.com/marudor/BahnhofsAbfahrten) a.k.a. [`marudor.de`](https://marudor.de/) – A very detailed public transport website for Germany. Uses HAFAS underneath, [has an API](https://docs.marudor.de). -- [`public-transport-enabler`](https://github.com/schildbach/public-transport-enabler) – Unleash public transport data in your Java project. -- [`TripKit`](https://github.com/alexander-albers/tripkit) – Swift library for querying data from public transport providers. -- [`pyhafas`](https://github.com/n0emis/pyhafas) – A python client for HaFAS public transport APIs. +- [`public-transport-enabler`](https://github.com/schildbach/public-transport-enabler) – Java equivalent to `hafas-client`, with support for more types of public transport APIs; Used by [Öffi](https://play.google.com/store/apps/details?id=de.schildbach.oeffi) & [Transportr](https://transportr.app). +- [`TripKit`](https://github.com/alexander-albers/tripkit) – Swift equivalent to `hafas-client`, with support for more types of public transport APIs; Used by [ÖPNV Navigator](https://apps.apple.com/de/app/öpnv-navigator/id1239908782). +- [`pyhafas`](https://github.com/n0emis/pyhafas) – Python equivalent to `hafas-client`, with support for more types of public transport APIs. - [*Friendly Public Transport Format*](https://github.com/public-transport/friendly-public-transport-format#friendly-public-transport-format-fptf) – A format for APIs, libraries and datasets containing and working with public transport data. - [`observe-hafas-client`](https://github.com/public-transport/observe-hafas-client) – Observe all departures/arrivals/etc. returned by `hafas-client`. - [`cached-hafas-client`](https://github.com/public-transport/cached-hafas-client) – Pass in a `hafas-client` instance, cache data from it. @@ -271,10 +239,12 @@ HAFAS endpoint | library - [`hafas-discover-stations`](https://github.com/derhuerst/hafas-discover-stations#hafas-discover-stations) – Pass in a HAFAS client, discover stations by querying departures. - [`hafas-estimate-station-weight`](https://github.com/derhuerst/hafas-estimate-station-weight#hafas-estimate-station-weight) – Pass in a HAFAS client, estimate the importance of a station. +More related libraries can be found [via the npm package index](https://www.npmjs.com/search?q=hafas). + ## Contributing -If you **have a question**, **found a bug** or want to **propose a feature**, have a look at [the issues page](https://github.com/public-transport/hafas-client/issues). +If you **have a question**, **found a bug** or want to **propose a feature**, please [open an Issue](https://github.com/public-transport/hafas-client/issues). This project needs help! Check the [list of "help wanted" Issues](https://github.com/public-transport/hafas-client/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).