Skip to main content

Koleo CLI

PyPI - Version PyPI - Python Version

Installation

install via pip by running pip install koleo-cli

gif showcasing the functionality

it currently allows you to:

  • get departures/arrival list for a station
  • get train info given its number and name(pull requests are welcome if you know how to get a train object by just the number)
  • find a station or list all known stations
  • find a connection from station a to b, with filtering by operators
  • save a station as your favourite to quickly check it's departures
  • add station aliases to query them more easily
  • check seat allocation statistics( authentication is required since may 2026 :< )
  • check delays(after login)

login

  • the current implementation allows you to store the credentials as cleartext, or instruct the koleo-cli to execute a command to retrieve them
  • the builtin login function allows you to store the data using secret-tool on linux, or cleartext on other platforms
  • you can create your own auth provider using the command auth type:
    • the program has to output a json k: v dump of cookies to be used, it must include:
      • the _koleo_token cookie(the v2 bearer auth token)

coming soon™️:

  • TUI ticket purchase interface
  • ticket display
  • your previous tickets + stats
  • find empty compartments

additionally you can also use the KoleoAPI wrapper directly in your own projects, all returns are fully typed using typing.TypedDict

MY(possibly controversial) design choices:

  • platforms and track numbers are shown using arabic numerals instead of roman
    • you can change it by adding use_roman_numerals: true to your koleo-cli.json config file
  • most api queries are cached for 24h
    • you can change it by adding disable_cache: true to your koleo-cli.json config file
  • stations/ls uses emojis by default
    • you can disable them by adding use_country_flags_emoji: false and use_country_flags_emoji: false to your koleo-cli.json config file pull requests are welcome!!
usage: koleo [-h] [-c CONFIG] [--ignore_cache] [--nocolor]
             {departures,d,dep,odjazdy,o,arrivals,a,arr,przyjazdy,p,all,w,wszystkie,all_trains,pociagi,trainroute,r,tr,t,poc,pociąg,traincalendar,kursowanie,tc,k,traindetail,td,tid,id,idpoc,stations,s,find,f,stacje,ls,q,connections,z,szukaj,path,destinations,do,to,z3,trainstats,ts,tp,miejsca,frekwencja,trainconnectionstats,tcs,aliases,clear_cache,login} ...

Koleo CLI

options:
  -h, --help            show this help message and exit
  -c, --config CONFIG   Custom config path.
  --ignore_cache
  --nocolor             Disable color output and formatting

actions:
  {departures,d,dep,odjazdy,o,arrivals,a,arr,przyjazdy,p,all,w,wszystkie,all_trains,pociagi,trainroute,r,tr,t,poc,pociąg,traincalendar,kursowanie,tc,k,traindetail,td,tid,id,idpoc,stations,s,find,f,stacje,ls,q,connections,z,szukaj,path,destinations,do,to,z3,trainstats,ts,tp,miejsca,frekwencja,trainconnectionstats,tcs,aliases,clear_cache,login}
    departures (d, dep, odjazdy, o)
                        Allows you to list station departures
    arrivals (a, arr, przyjazdy, p)
                        Allows you to list station departures
    all (w, wszystkie, all_trains, pociagi)
                        Allows you to list all station trains
    trainroute (r, tr, t, poc, pociąg)
                        Allows you to check the train's route
    traincalendar (kursowanie, tc, k)
                        Allows you to check what days the train runs on
    traindetail (td, tid, id, idpoc)
                        Allows you to show the train's route given it's koleo ID
    stations (s, find, f, stacje, ls, q)
                        Allows you to find stations by their name
    connections (z, szukaj, path)
                        Allows you to search for connections from a to b
    destination_connections (destinations, do, to)
                        Allows you to search for connections from favourite_station to x
    v3_connections (z3)
                        Allows you to search for connections from a to b using V3 Koleo Search
    trainstats (ts, tp, miejsca, frekwencja)
                        Allows you to check seat allocation info for a train.
    trainconnectionstats (tcs)
                        Allows you to check the seat allocations on the train connection given it's koleo ID
    aliases             Save quick aliases for station names!
    clear_cache         Allows you to clear koleo-cli cache
    login               Allows you to login(this is required for trainstats:<)

Example Config

{
  "cache": {},
  "favourite_station": "czarna-bialostocka",
  "disable_cache": false,
  "use_roman_numerals": false,
  "aliases": {
    "bzw": "bialystok-zielone-wzgorza",
    "b": "bialystok",
    "s": "sokolka",
    "su": "suwalki",
    "bp": "bielsk-podlaski",
    "ww": "warszawa-wschodnia",
    "e": "elk",
    "og": "olsztyn-glowny",
    "kg": "krakow-glowny",
    "k": "katowice",
    "bb": "bialystok-bacieczki",
    "wg": "warszawa-gdanska",
    "wz": "warszawa-zachodnia",
    "wc": "warszawa-centralna",
    "bbg": "bielsko-biala-glowna",
    "cb": "czarna-bialostocka",
    "bdg": "bydgoszcz-glowna",
    "sg": "szczecin-glowny"
  },
  "show_connection_id": false,
  "use_country_flags_emoji": true,
  "use_station_type_emoji": true,
  "platform_first": false,
  "auto_głównx": true,
  "show_seconds": false,
  "auth": {
    "type": "command",
    "data": [
      "secret-tool",
      "lookup",
      "service",
      "koleo-cli",
      "account",
      "default"
    ],
    "on_update": [
      "secret-tool",
      "store",
      "--label='Koleo-CLI Auth'",
      "service",
      "koleo-cli",
      "account",
      "default"
    ]
  }
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

koleo_cli-0.2.137.37.tar.gz (52.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

koleo_cli-0.2.137.37-py3-none-any.whl (56.4 kB view details)

Uploaded Python 3

File details

Details for the file koleo_cli-0.2.137.37.tar.gz.

File metadata

  • Download URL: koleo_cli-0.2.137.37.tar.gz
  • Upload date:
  • Size: 52.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for koleo_cli-0.2.137.37.tar.gz
Algorithm Hash digest
SHA256 ae46e6790703525013a1ace0f78d6d63a5b1dc7b9939d0179c95db688bb62cb3
MD5 5f94c5d4465eee42e75ee74e5305a69f
BLAKE2b-256 d3b39691aa39365e9a82eac1eefc9d3b99a3ab726e2f98130b15e559d2db7063

See more details on using hashes here.

File details

Details for the file koleo_cli-0.2.137.37-py3-none-any.whl.

File metadata

  • Download URL: koleo_cli-0.2.137.37-py3-none-any.whl
  • Upload date:
  • Size: 56.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for koleo_cli-0.2.137.37-py3-none-any.whl
Algorithm Hash digest
SHA256 fa91c5cb1bbdf41023052569bc0f088736206708905ce1677ddc641ef6e25a16
MD5 607db2dedd9b01d1ffaf658222a57aee
BLAKE2b-256 e18d7a7e919c1bfe34a356c7447bcdab2fe3c47c891f4d26383f0ea0b229d879

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.137.37 This release

2 files

0.2.137.36

2 files

0.2.137.35

2 files

0.2.137.34

2 files

0.2.137.32

2 files

0.2.137.31

2 files

0.2.137.30

2 files

0.2.137.29

2 files

0.2.137.28

2 files

0.2.137.27

2 files

0.2.137.26

2 files

0.2.137.25

2 files

0.2.137.24.2

2 files

0.2.137.24.1

2 files

0.2.137.24

2 files

0.2.137.23.3

2 files

0.2.137.23.2

2 files

0.2.137.23

2 files

0.2.137.22

2 files

0.2.137.21

2 files

0.2.137.20

2 files

0.2.137.19

2 files

0.2.137.18

2 files

0.2.137.17

2 files

0.2.137.16

2 files

0.2.137.15

2 files

0.2.137.14

2 files

0.2.137.13

2 files

0.2.137.12

2 files

0.2.137.11

2 files

0.2.137.10

2 files

0.2.137.9

2 files

0.2.137.8

2 files

0.2.137.7

2 files

0.2.137.6

2 files

0.2.137.5

2 files

0.2.137.4

2 files

0.2.137.3

2 files

0.2.137.2

2 files

0.2.137.1

2 files

0.2.137

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page