Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tmb

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tmb

Library that interacts with TMB API

  • 0.1.5
  • PyPI
  • Socket score

Maintainers
1

tmb - Python library for TMB API

build downloads version

Library to interact with the TMB (Transports Metropolitans de Barcelona) API.

Currently it supports the following TMB services:

  • iBus (get remain minutes for a given stop and line)
  • Planner (Get list of itineraries to go from from_coords to to_coords)

Generate API keys

  • Go to developer.tmb.cat.
  • 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.

Example

iBus

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")

Planner

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

from tmb import Planner

planner = Planner(APP_ID, APP_KEY)
plans = planner.get_itineraries('41.3755204,2.1498870', '41.3878951,2.1308587')
print(plans)

Projects Depending on tmb

https://github.com/home-assistant/home-assistant

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc