Skip to content

bartekl1/poznan-transport-cli

Repository files navigation

🚊 poznan-transport-cli

Unofficial command line interface for ZTM PoznaΕ„ API
Check positions and timetables for buses and trams in PoznaΕ„

GitHub release (latest by date) GitHub Repo stars GitHub watchers GitHub forks

πŸ•‘ Changelog 🎁 Acknowledgements πŸ‡΅πŸ‡± Polish version of README

Available functions

  • Check position of vehicle
  • List all lines
  • Get line description
  • Check timetable

Installation

Node.js is required to install and use this program.

npm install -g poznan-transport-cli

Usage

poznan-transport-cli <command> <options>

Get help

Global help

poznan-transport-cli help
poznan-transport-cli --help
poznan-transport-cli -h

Command help

poznan-transport-cli <command> --help
poznan-transport-cli <command> -h

Get version

poznan-transport-cli version
poznan-transport-cli --version
poznan-transport-cli -v

Vehicle positions

poznan-transport-cli position <options> <search>

Command displays line number, vehicle number, brigade number, position and direction.

Search

If you do not specify a search query, the command displays the positions of all vehicles.

You can search by line number, vehicle number or brigade number.

If you pass --line-number argument, the command searches only by line number. If you pass --vehicle-number argument, the command searches only by vehicle number. If you pass --brigade-number argument, the command searches only by brigade number.

Example commands

poznan-transport-cli position
poznan-transport-cli position 5
poznan-transport-cli position 5 --line-number
poznan-transport-cli position 427 --vehicle-number
poznan-transport-cli position 5/9 --brigade-number

Example

Command:

poznan-transport-cli position 5

Output:

β”Œβ”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Line β”‚ Vehicle β”‚ Brigade β”‚ Position                               β”‚ Direction    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 5    β”‚ 450     β”‚ 5/10    β”‚ 52.38100814819336, 16.879940032958984  β”‚ Zawady       β”‚
β”‚ 5    β”‚ 436     β”‚ 5/6     β”‚ 52.40298843383789, 16.915029525756836  β”‚ GΓ³rczyn PKM  β”‚
β”‚ 5    β”‚ 447     β”‚ 5/7     β”‚ 52.4033317565918, 16.954439163208008   β”‚ GΓ³rczyn PKM  β”‚
β”‚ 5    β”‚ 418     β”‚ 5/8     β”‚ 52.40589904785156, 16.93073081970215   β”‚ Zawady       β”‚
β”‚ 5    β”‚ 427     β”‚ 5/9     β”‚ 52.381099700927734, 16.881160736083984 β”‚ Zawady       β”‚
β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Routes

poznan-transport-cli route <search>

Command displays line number, vehicle type, direction and agency.

If you do not specify a search query, the command displays all routes.

Examples

Command:

poznan-transport-cli route

Output:

β”Œβ”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Line β”‚ Type β”‚ Direction                                                    β”‚ Agency                                                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 0    β”‚ Tram β”‚ PL. WIELKOPOLSKI - PL. WIELKOPOLSKI                          β”‚ Miejskie PrzedsiΔ™biorstwo Komunikacyjne Sp. z o.o. w Poznaniu β”‚
│ 1    │ Tram │ BUDZISZYŃSKA - FRANOWO                                       │ Miejskie Przedsiębiorstwo Komunikacyjne Sp. z o.o. w Poznaniu │
β”‚ 2    β”‚ Tram β”‚ DĘBIEC PKM - STARE ZOO                                       β”‚ Miejskie PrzedsiΔ™biorstwo Komunikacyjne Sp. z o.o. w Poznaniu β”‚
β”‚ 3    β”‚ Tram β”‚ UNII LUBELSKIEJ - BŁAΕ»EJA                                    β”‚ Miejskie PrzedsiΔ™biorstwo Komunikacyjne Sp. z o.o. w Poznaniu β”‚
β”‚ 5    β”‚ Tram β”‚ ZAWADY - GΓ“RCZYN PKM                                         β”‚ Miejskie PrzedsiΔ™biorstwo Komunikacyjne Sp. z o.o. w Poznaniu β”‚
β”‚ 6    β”‚ Tram β”‚ MIŁOSTOWO - BUDZISZYΕƒSKA                                     β”‚ Miejskie PrzedsiΔ™biorstwo Komunikacyjne Sp. z o.o. w Poznaniu β”‚
β”‚ 7    β”‚ Tram β”‚ POŁABSKA - OGRODY                                            β”‚ Miejskie PrzedsiΔ™biorstwo Komunikacyjne Sp. z o.o. w Poznaniu β”‚
β”‚ 8    β”‚ Tram β”‚ OGRODY - MIŁOSTOWO                                           β”‚ Miejskie PrzedsiΔ™biorstwo Komunikacyjne Sp. z o.o. w Poznaniu β”‚
β”‚ 9    β”‚ Tram β”‚ DĘBIEC PKM - PIΔ„TKOWSKA                                      β”‚ Miejskie PrzedsiΔ™biorstwo Komunikacyjne Sp. z o.o. w Poznaniu β”‚
...
β”‚ 905  β”‚ Bus  β”‚ OS. SOBIESKIEGO - CHLUDOWO SZKOŁA                            β”‚ ZakΕ‚ad Komunikacji Publicznej Suchy Las Sp. z o.o.            β”‚
β”‚ 907  β”‚ Bus  β”‚ OS. SOBIESKIEGO - CHLUDOWO SZKOŁA                            β”‚ ZakΕ‚ad Komunikacji Publicznej Suchy Las Sp. z o.o.            β”‚
β”‚ 911  β”‚ Bus  β”‚ RONDO ŚRΓ“DKA - BIEDRUSKO PARK                                β”‚ Miejskie PrzedsiΔ™biorstwo Komunikacyjne Sp. z o.o. w Poznaniu β”‚
β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Command:

poznan-transport-cli route 5

Output:

ROUTE 5
Direction: ZAWADY - GΓ“RCZYN PKM
Type: Tram
Agency: Miejskie PrzedsiΔ™biorstwo Komunikacyjne Sp. z o.o. w Poznaniu

Route:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ZAWADY                β”‚ GΓ“RCZYN PKM           β”‚
β”‚ Podwale               β”‚ Matyi                 β”‚
β”‚ Jana PawΕ‚a II         β”‚ Towarowa              β”‚
β”‚ KΓ³rnicka              β”‚ ŚwiΔ™ty Marcin         β”‚
β”‚ Mostowa               β”‚ Aleje Marcinkowskiego β”‚
β”‚ pl. BernardyΕ„ski      β”‚ PodgΓ³rna              β”‚
β”‚ PodgΓ³rna              β”‚ pl. BernardyΕ„ski      β”‚
β”‚ Aleje Marcinkowskiego β”‚ Mostowa               β”‚
β”‚ 27 Grudnia            β”‚ KΓ³rnicka              β”‚
β”‚ Gwarna                β”‚ Jana PawΕ‚a II         β”‚
β”‚ ŚwiΔ™ty Marcin         β”‚ Podwale               β”‚
β”‚ Towarowa              β”‚ ZAWADY                β”‚
β”‚ Matyi                 β”‚                       β”‚
β”‚ GΕ‚ogowska             β”‚                       β”‚
β”‚ GΓ“RCZYN PKM           β”‚                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Timetables

poznan-transport-cli timetable <line> <stop>

You need to specify line number and stop ID.

Example

Command:

poznan-transport-cli timetable 5 134

Output:

 WORKDAYS                   SATURDAYS                  SUNDAYS
β”Œβ”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 04 β”‚                   β”‚ β”‚ 04 β”‚ 53                β”‚ β”‚ 04 β”‚                   β”‚
β”‚ 05 β”‚ 00 14 28 43 58    β”‚ β”‚ 05 β”‚ 13 32 52          β”‚ β”‚ 05 β”‚                   β”‚
β”‚ 06 β”‚ 13 23 33 43 53    β”‚ β”‚ 06 β”‚ 12 32 52          β”‚ β”‚ 06 β”‚ 07 37             β”‚
β”‚ 07 β”‚ 03 13 23 33 43 53 β”‚ β”‚ 07 β”‚ 12 32 52          β”‚ β”‚ 07 β”‚ 07 37             β”‚
β”‚ 08 β”‚ 03 13 23 33 43 53 β”‚ β”‚ 08 β”‚ 12 32 52          β”‚ β”‚ 08 β”‚ 07 37             β”‚
β”‚ 09 β”‚ 03 13 28 33 43 58 β”‚ β”‚ 09 β”‚ 12 32 52          β”‚ β”‚ 09 β”‚ 07 37             β”‚
β”‚ 10 β”‚ 13 28 43 58       β”‚ β”‚ 10 β”‚ 12 32 52          β”‚ β”‚ 10 β”‚ 07 32 52          β”‚
β”‚ 11 β”‚ 13 28 43 58       β”‚ β”‚ 11 β”‚ 12 32 52          β”‚ β”‚ 11 β”‚ 12 32 52          β”‚
β”‚ 12 β”‚ 13 28 43 58       β”‚ β”‚ 12 β”‚ 12 32 52          β”‚ β”‚ 12 β”‚ 12 32 52          β”‚
β”‚ 13 β”‚ 13 23 33 43 53    β”‚ β”‚ 13 β”‚ 12 32 52          β”‚ β”‚ 13 β”‚ 12 32 52          β”‚
β”‚ 14 β”‚ 03 13 23 33 43 53 β”‚ β”‚ 14 β”‚ 12 32 52          β”‚ β”‚ 14 β”‚ 12 32 52          β”‚
β”‚ 15 β”‚ 03 13 23 33 43 53 β”‚ β”‚ 15 β”‚ 12 32 52          β”‚ β”‚ 15 β”‚ 12 32 52          β”‚
β”‚ 16 β”‚ 03 13 23 33 43 53 β”‚ β”‚ 16 β”‚ 12 32 52          β”‚ β”‚ 16 β”‚ 12 32 52          β”‚
β”‚ 17 β”‚ 03 13 23 33 43 53 β”‚ β”‚ 17 β”‚ 12 32 52          β”‚ β”‚ 17 β”‚ 12 32 52          β”‚
β”‚ 18 β”‚ 03 13 23 33 42 52 β”‚ β”‚ 18 β”‚ 12 32 52          β”‚ β”‚ 18 β”‚ 12 32 52          β”‚
β”‚ 19 β”‚ 02 12 32 52       β”‚ β”‚ 19 β”‚ 12 32 52          β”‚ β”‚ 19 β”‚ 12 32 52          β”‚
β”‚ 20 β”‚ 12 32 52          β”‚ β”‚ 20 β”‚ 12 32 52          β”‚ β”‚ 20 β”‚ 12 32 52          β”‚
β”‚ 21 β”‚ 12 32 52          β”‚ β”‚ 21 β”‚ 12 32 52          β”‚ β”‚ 21 β”‚ 12 32 52          β”‚
β”‚ 22 β”‚ 12 32 47          β”‚ β”‚ 22 β”‚ 12 32 47          β”‚ β”‚ 22 β”‚ 12 32 47          β”‚
β”‚ 23 β”‚ 07                β”‚ β”‚ 23 β”‚ 07                β”‚ β”‚ 23 β”‚ 07                β”‚
β””β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜