CLI to query for public transport connections in switzerland

Overview

Swiss Public Transport CLI

This is a simple tool to search public transport connections from one station to another, possible with a via.

It uses the public transportation data from https://opendata.ch and is written in rust.

Installation

cargo install spt_cli

Usage

spt_cli 0.1.5
Sandro Covo
CLI tool to query connections for swiss public transport

USAGE:
    spt_cli [OPTIONS] <TO> [VIA]

ARGS:
    <TO>     
    <VIA>    

OPTIONS:
    -c, --color              Always output colors
    -d, --date <DATE>        Date of connection, otherwise the current date is used
    -f, --from <FROM>        Starting point of journey, can be configured
    -h, --help               Print help information
    -i, --is-arrival-time    If set the given time is treated as arrival time, otherwise as
                             departure time
    -l, --limit <LIMIT>      Max. number of results, between 1 and 16
    -n, --no-color           Never output colors
    -t, --time <TIME>        Time of connection, otherwise the current time is used
    -V, --version            Print version information

Configuration

You can specify default values for from, limit and color in .config/spt_cli.json:

{
    "from": "Lenzburg",
    "limit": 1,
    "color": false
}

Examples

# Simple
spt_cli ZΓΌrich Bern

# Specify a time
spt_cli --time 10:00 Basel Chur

# Use a via
spt_cli Basel Genve Biel

spt_cli --help # show all options

Screen Recording

asciicast

Contribution

Issues and merge requests are welcome

You might also like...
Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other projects
Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other projects

Mercy πŸ“š Documentation Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other pro

Rust bindings to the RVVM's public api

rvvm [WIP] Safe Rust bindings to the RVVM's public API. Provides the Rust-idiomatic interface to the RVVM public API. Implemented Virtual machine crea

A high-performance WebSocket integration library for streaming public market data. Used as a key dependency of the `barter-rs` project.

Barter-Data A high-performance WebSocket integration library for streaming public market data from leading cryptocurrency exchanges - batteries includ

Automatically replace Discord CDN links with local file links, by downloading the images to the public folder
Automatically replace Discord CDN links with local file links, by downloading the images to the public folder

Auto Undiscord Did you hear that Discord will be blocking external websites from using images hosted on their servers? Did you host every image on you

On-chain query aggregator/batcher in Terra.
On-chain query aggregator/batcher in Terra.

Multicall On-chain query aggregator/batcher in Terra. Mainnet Code Id: 3758 Mainnet Address: terra1y60jx2jqh5qpmcnvgz3n0zg2p6ky4mr6ax2qa5 Testnet Code

Track and query Cargo dependency graphs.

cargo-guppy: track and query dependency graphs This repository contains the source code for: guppy: a library for performing queries on Cargo dependen

Fgr - Find & Grep utility with SQL-like query language

fgr Find & Grep utility with SQL-like query language. Examples # Find all files with name equal to sample under the current directory: fgr -e name=sam

Command line tool to query the Oxford Dictionaries API.
Command line tool to query the Oxford Dictionaries API.

oxd Oxd is a client library for the Oxford Dictionary API. It provides a series of structs modeling entries returned from the API, a function [get_ent

Leptos Query - a robust asynchronous state management library for Leptos,

Leptos Query is a robust asynchronous state management library for Leptos, providing simplified data fetching, integrated reactivity, server-side rendering support, and intelligent cache management.

Comments
  • Escape sequences not working

    Escape sequences not working

    Nice tool!

    Escape sequences do not work on my machine. Sample output:

    ESC[1mSargans β‡’ ZΓΌrich HBESC[0m
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    #1: 21:27 - 22:22, Leaves in  00:17
    
    ESC[44;37m 21:27: Sargans                                         2   ESC[0m
    ESC[36m   ┃  
    ESC[0mESC[44;37m 22:22: ZΓΌrich HB                                       6   ESC[0m
    
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    #2: 21:35 - 22:48, Leaves in  00:25
    
    ESC[44;37m 21:35: Sargans                                         2   ESC[0m
    ESC[36m   ┃  
    ESC[0mESC[44;37m 22:48: ZΓΌrich HB                                       8   ESC[0m
    
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    

    No idea, whether it's a question of the console the shell or whatever... I'm on Linux in a KDE konsole. Installed v0.1.2 with cargo install.

    opened by pka 2
  • Number of results

    Number of results

    I've build the project without issues on my Linux and Windows machine, kudos again for the effort! Just to continue on my #1 riff - how about a number of results argument? I would probably just leave the default at "1", but in any case it would be good to let the user decide how many connections they want to see.

    opened by loleg 1
  • Pager library

    Pager library

    Currently the project doesn't build on Windows due to an issue in pager. It doesn't seem to be actively supported. For one line of code (almost), why not switch to https://github.com/Riey/rust-pager ?

    opened by loleg 1
Owner
Sandro Covo
Sandro Covo
Get up-to-date departure times for Munich public transport in your terminal.

MVG Fahrinfo MVG Fahrinfo is a CLI tool to keep up-to-date with latest departure times of Munich public transport. The app is a native binary and uses

Faisal Bin Ahmed 70 Nov 14, 2023
Free and open public transport routing.

Transitous Free and open public transport routing. Goal A community-run provider-neutral international public transport routing service. Using openly

Public Transport 108 Mar 24, 2024
⚑️ A blazing fast way of maintaining powerful notes with connections between them.

Zettl ⚑️ A blazing fast way of maintaining powerful notes with connections between them. Installing Zettl To install Zettl, you will need the Rust too

Tirth Jain 26 Dec 2, 2022
Show active TCP connections on a TUI world map.

Maperick Show active TCP connections on a TUI world map. Still WIP, but it's gonna be good. Setup git clone [email protected]:schlunsen/maperick.git cd m

Rasmus SchlΓΌnsen 5 Jul 8, 2022
BoilerFiles is a CLI for downloading your boilerplate files from a public GitHub template repo.

BoilerFiles Available on crates.io. BoilerFiles is a CLI for downloading your boilerplate files from a public GitHub template repo. Features Are you t

Jan MΓΌller 4 Oct 1, 2022
qsv - Performant CLI tool to query CSVs through SQL

qsv Performant CLI tool to query CSVs through SQL Installation After cloning the repository, you can install a binary locally using cargo install --pa

Dermot Haughey 3 Oct 28, 2021
A small CLI tool to query ArcGIS REST API services, implemented in Rust. The server response is returned as pretty JSON.

A small CLI tool to query ArcGIS REST API services, implemented in Rust. The server response is returned as pretty JSON.

Andrew Vitale 2 Apr 25, 2022
Donate To Charity (A.K.A. Public Goods) Without Lossing Anything

Donate To Charity (A.K.A. Public Goods) Without Lossing Anything

Gajesh Naik 10 Mar 3, 2022
Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other projects

Mercy ?? Documentation Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other pro

Umiko Security 2 Nov 27, 2022
Linkal - A public-calendar aggregator server

Linkal Linkal is a public-calendar aggregator server. Given a set a public calendars links, it can make a CalDav client believe all these calendars ar

Julien Malka 87 Dec 10, 2022