Skip to content

valeskini/railkitty

Repository files navigation

Info

Im planning to collect all major eu railway operators here. Then im planning on creating a algorithm to generate routes and when thats done i will create a app in flutter to give the whole project a ui.

Right now its only starting out but im planning on working on this long term.

valeskini/railkitty

Unified TypeScript SDK to fetch and standardize stations, journeys, and prices from various European railway operators.

Copyright (c) 2026 Massi Valeskini. All rights reserved. Commercial use, reproduction, or distribution is strictly prohibited.

Thanks to:

https://github.com/SimoDax/Italo-API/wiki/API-Italo https://github.com/SimoDax/Trenitalia-API/wiki/Nuove-API-Trenitalia-lefrecce.it https://github.com/FoxWorn3365/Trenitalia-API-Docs https://github.com/public-transport/oebb https://git.lattuga.net/roughconsensusandrunningcode/TrainMonitor

Project Structure

The project is structured as follows:

  • src/: Contains the source code for the SDK.
    • core/: Core modules like the logger and cache.
    • operators/: Contains the implementations for the different railway operators.
      • base.ts: The base class for all operators.
      • oebb/: The implementation for the ÖBB (Austrian Federal Railways).
      • trenitalia/: A placeholder for the Trenitalia (Italian railway) implementation.
    • types/: Contains the shared TypeScript types and interfaces for the SDK.
    • index.ts: The main entry point of the application.
  • tests/: Contains the tests for the SDK.
    • integration/: Integration tests that make real API calls.
    • unit/: Unit tests for individual modules.
    • registry/: Mocks for the API responses.

Available Scripts

In the project directory, you can run:

  • npm run build: Compiles the TypeScript code to JavaScript.
  • npm run dev: Starts the development server with hot reloading.
  • npm run test: Runs the unit tests.
  • npm run test:watch: Runs the unit tests in watch mode.
  • npm run test:int: Runs the integration tests.
  • npm run test:all: Runs all tests (unit and integration).
  • npm run lint: Lints the codebase.

Usage

This SDK is intended to be used as a library in other projects. It provides a unified interface to interact with different railway operators.

First, you need to instantiate an operator:

import { OebbProvider } from './operators/oebb';

const oebb = new OebbProvider();

Then you can use the operator to search for stations and journeys:

const stations = await oebb.searchStations('Wien');

const journeys = await oebb.searchJourneys({
  originId: '8100001', // Wien Hbf
  destinationId: '8100157', // Salzburg Hbf
  departAfter: new Date(),
});

About

Unified TypeScript SDK to fetch and standardize stations, journeys, and prices from various European railway operators.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors