GithubHelp home page GithubHelp logo

atbcli's Introduction

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

atbcli's People

Contributors

jorgenbele avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.