db-vendo-client/p/readme.md
Kristjan 15be4a0b58 Introduce a 'profile id' column
This is helpful to choose the right profile. The folder name corresponds to the 'profile id' that I have to specify when I create a client. I haven't seen such an overview yet.

I'm not sure if 'profile id' is the appropriate term.
2021-03-26 01:10:28 +01:00

7.8 KiB

hafas-client profiles

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).

built-in profiles

There are built-in profiles for these public transportation networks:

HAFAS endpoint wrapper library docs example code source code profile id (folder)
Deutsche Bahn (DB) db-hafas docs example src db
Swiss Railways (SBB) - docs example src sbb
Polskie Koleje Państwowe (PKP) pkp-hafas docs example src pkp
Belgian National Railways (SNCB/NMBS) - docs example src sncb
Iarnród Éireann (Irish Rail) - docs example src irish-rail
Berlin & Brandenburg public transport (VBB) vbb-hafas docs example src vbb
Berlin public transport (BVG) bvg-hafas docs example src bvg
Österreichische Bundesbahnen (ÖBB) oebb-hafas docs example src oebb
Mobilitéitszentral (Luxembourg) - docs example src mobiliteit-lu
Bay Area Rapid Transit (BART) - docs example src bart
Nahverkehr Sachsen-Anhalt (NASA)/INSA insa-hafas docs example src insa
Nahverkehrsverbund Schleswig-Holstein (NAH.SH) nahsh-hafas docs example src nahsh
Rhein-Main-Verkehrsverbund (RMV) - docs example src rmv
Austin, Texas (CMTA/CapMetro) - docs example src cmta
S-Bahn München - docs example src sbahn-muenchen
Saarfahrplan/VGS (Saarland) - docs example src saarfahrplan
Société Nationale des Chemins de Fer Luxembourgeois (CFL) - docs example src cfl
Hamburg public transport (HVV) - docs example src hvv
Nordhessischer Verkehrsverbund (NVV) (Hesse) - docs example src nvv
mobil.nrw - docs example src dmobil-nrw
DB Busradar NRW (DB Regio Bus) - docs example src db-busradar-nrw
Verkehrsverbund Süd-Niedersachsen (VSN) - docs example src vsn
Ingolstädter Verkehrsgesellschaft (INVG) - docs example src invg
Verkehrsverbund Bremen/Niedersachsen (VBN) - docs example src vbn
Verkehrsverbund Rhein-Neckar (VRN) - docs example src vrn
Rostocker Straßenbahn AG (RSAG) - docs example src rsag
Verkehrsverbund Mittelthüringen (VMT) - docs example src vmt
Verkehrsgemeinschaft Osnabrück (VOS) - docs example src vos
Aachener Verkehrsverbund (AVV) - docs example src avv
Salzburg public transport (SVV) - docs example src svv
Verkehrsverbund Tirol (VVT) - docs example src vvt
Kärntner Linien/Verkehrsverbund Kärnten (VKG/VVK) - docs example src vkg
Zürich public transport (ZVV) - docs example src zvv

writing your own

If you want to write a profile for an endpoint, check out the writing a profile guide.

Your profile must be passed into createClient and is expected to be in a certain structure:

const createClient = require('hafas-client')

const myCustomProfile = {
	// …
}

// create a client with the profile
const client = createClient(myCustomProfile)

// use it to query data
await client.journeys('1234', '2345')