Skip to main content

Library that interacts with TMB API

Project description

tmb - Library for TMB API

Use this library to interact with the TMB (Transports Metropolitans de Barcelona) API.


It supports the following services

  • iBus (get remain minutes for a given stop and line)

Generate API keys

  • Go to
  • Login using your personal account.
  • Create a new application, call it as you want.
  • Once created, you will see two variables: APP_ID and APP_KEY.



Create the iBus object using the API keys generated from TMB portal.

from tmb import IBus

ibus = IBus(APP_ID, APP_KEY)
forecast = ibus.get_stop_forecast('1265','V19')
print(f"{forecast} mins")

Projects Depending on tmb

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tmb, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size tmb-0.0.4-py3-none-any.whl (3.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size tmb-0.0.4.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page