Skip to content

AtB travel route planner cli written in python

Notifications You must be signed in to change notification settings

jorgenbele/atbcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

AtB Cli

Dependencies

# pip3 packages
arrow
bs4
requests
docopt
iterfzf

# packages
fzf  # used for selecting autocompletion alternatives

Usage

Usage: atb [(<from_stop> <to_stop>) | <saved_route>] [options]

Options:
  --pretty
  --terse
  -v, --verbose                  Enable verbose output
  --no-suggestions               Disable the use of AtB bus-stop suggestions (on by default when --to or --from is provided)
  --routes-file <routes_file>    Use a custom route file (default: ~/.config/atb/routes.json)
  --from <from_stop>             Alternative way to specify, or override 'from' bus-stop.
  --to <to_stop>                 Alternative way to specify, or override 'to' bus-stop.


Note:
   If <saved_route> is provided as well as <from_stop> and/or <to_stop>
   then one can override the from/to field of the <saved_route>.

Example usage

From Solsiden to Elgeseter

$ atb Solsiden Elgeseter
:: AtB
:: From Solsiden (Trondheim) to Elgeseter gate (Trondheim)
19:30 0:10 22 	->  9
19:31 0:11 9 	->  4
19:35 0:11 4 	->  7
19:40 0:11 7 	->  9
19:51 0:11 9 	->  4
19:55 0:11 4 	->  66
19:57 0:12 66 	->  55 	->  22
20:00 0:10 22 	->  7
20:10 0:11 7 	->  9
20:11 0:11 9 	->  walking

Using predefined route: home

You can predefine routes in a routes.json file. By default this file is stored in \~/.config/atb/routes.json, but it can be set by using the --routes-file option, as seen in the following example.

# See example_routes.json
$ atb --routes-file example_routes.json home
:: AtB
:: From Solsiden (Trondheim) to Elgeseter gate (Trondheim)
19:30 0:10 22 	->  9
19:31 0:11 9 	->  4
19:35 0:11 4 	->  7
19:40 0:11 7 	->  9
19:51 0:11 9 	->  4
19:55 0:11 4 	->  66
19:57 0:12 66 	->  55 	->  22
20:00 0:10 22 	->  7
20:10 0:11 7 	->  9
20:11 0:11 9 	->  walking

Overridden saved route: home

Sometimes you want to override your usual route. To achieve this just use the --to and --from options. In the following example the from bus-stop for the route ‘home’ is overriden with ‘Hommelvik’.

# See example_routes.json
$ atb --routes-file example_routes.json home --from Hommelvik
:: AtB
:: From Hommelvik to Studentersamfundet (Trondheim)
20:36 0:42 310
20:36 0:34 310 	->  46
22:36 0:42 310
22:36 0:34 310 	->  46
06:06 0:42 310
06:06 0:34 310 	->  46
06:40 0:42 310
06:40 0:36 310 	->  3
06:51 0:39 310
06:51 0:34 310 	->  46

About

AtB travel route planner cli written in python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages