Skip to main content

Next Bus Bot

A bot/ cli tool that simply gives you the waiting times for next buses at your favorite bus stop.

It works only for the IDFM/RATP Network, relying on the api lines/v4. For now only a handfull of bus stops on the Plateau de Saclay are registered, but you can add your own

Example

$ nbb mdv
Next buses at Mare du Vivier:
- ⏰  6 min. (12:29)  9️⃣ 🚍 ▶ Centre Commercial Ulis 2
- ⏰ 27 min. (12:50)  9️⃣ 🚍 ▶ Gare de Jouy en Josas
- ⏰ 35 min. (12:58)  9️⃣ 🚍 ▶ Centre Commercial Ulis 2
- ⏰ 53 min. (13:16)  9️⃣ 🚍 ▶ Christ de Saclay

Installation

Pip Installation

$ pip install next-bus-bot

Developer Installation

  1. clone the repo

    $ git clone git@github.com:paquiteau/nbb/
  2. create your venv with your favorite tool

  3. Install locally the package with bells and whistles

    $ (venv) pip install -e .[dev,test]

TODO

  • automatic aliasing of stops (based on initials)

  • support for direction filtering

  • Add support for a bot front-end (slack, discord, IRC, etc).

  • Extend the useful bus stops.

Configuration

nbb can be configured via its command line argument, or via a config file nbb_conf.toml, it uses TOML https://toml.io/en/ syntax formatting. Suitable location for the config file are, loaded in this order:

  1. nbb/nbb_conf.toml

  2. ~/.config/nbb_conf.toml

  3. nbb_conf.toml in current directory.

  4. nbb –config <file>

An example (and default) config file is available in nbb/nbb_conf, and a example config is:

[cli]
# Default parameters for the CLI
pretty = true     # Emoji in the terminal
compact = false    # More condensed output
verbose = false    # More verbose output, only for debugging.

[stop.places]
# List of bus stops, with their name and their ID
# You can find the ID of a stop by looking at the URL of the stop on the IDFM website
# https://data.iledefrance-mobilites.fr/explore/dataset/zones-de-correspondance/custom/?disjunctive.zdctype

# The name of the step as a key does not matter,
# it should only be consistent between the stops, stops.aliases and stop.directions sections.
#
# The first stop defined is the default one.

[stop.aliases]
# Aliases for the stops defined in stop.places
"Mare du Vivier" = ["CEA Porte Sud", "Neurospin", "nsp", "mdv"]
"Moulon" = ["ens"]
"Raoul Dautry" = ["CEA Porte Est"]
"Place Marguerite Perey" = ["Inria"]


[stop.direction_filter]
# Direction filter for the stops defined in stop.places.

# For each stop you can filter the direction
"Mare du Vivier" = ["Gare du Guichet", "Centre Commercial Ulis 2"]      # Only keep the buses that have either 'gare du guichet'  or  'Centre commercial ulis2' as destination.
"Moulon" = ["Gare du Guichet", "Centre Commercial Ulis 2"]      # Only keep the gare du guichet  and Centre commercial ulis2

Metadata

Release files for next-bus-bot 1.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for next-bus-bot 1.3.2
File Size Uploaded
next-bus-bot-1.3.2.tar.gz 12.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for next-bus-bot 1.3.2
File Interpreter ABI Platform
next_bus_bot-1.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 23.8 kB

Release files / next-bus-bot-1.3.2.tar.gz

Download URL next-bus-bot-1.3.2.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1b15987491612a59383974aedd704bad25845ebe7b39c5bfe26c78bebe6176de
BLAKE2b-256 checksum
How to use checksums
e0900287e3cb277d27fac0fac606d26a7d5394a7dc8477a48695059d6b436d53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / next_bus_bot-1.3.2-py3-none-any.whl

Download URL next_bus_bot-1.3.2-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f7c71039629c94f48b249bf50fb64ba5282edd36289f09a66814fee6fac5462
BLAKE2b-256 checksum
How to use checksums
469815e0b1a4af7d4cd099ae0435c43450a01f93486a5e32f0cb31a45ac90898
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.3.2 This release

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page