tmb - Python library for TMB API
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_coordstoto_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_IDandAPP_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
Metadata
Release files for tmb 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tmb-0.1.5.tar.gz | 4.5 kB | Without provenance | Details for tmb-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tmb-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for tmb-0.1.5-py3-none-any.whl |
Total release size: 9.1 kB
Release files / tmb-0.1.5.tar.gz
| Download URL | tmb-0.1.5.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41d28eb9679882f9a56aa11a117781d06419c4a5da7d9c75da75da5c2d7d2019
|
|
BLAKE2b-256 checksum How to use checksums |
fde278f0b732c4dcac886a4d4b8dfcf629fa99e7b5a27bf39fa397dd710c2bf0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Release files / tmb-0.1.5-py3-none-any.whl
| Download URL | tmb-0.1.5-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f658fe75934e40890d37b591bf6d4f370b727f591622e69eaa7826a11a6a529
|
|
BLAKE2b-256 checksum How to use checksums |
8cdc8c9bdef5f7356d89c765e0127cb80c61ae7feb586bf25a8ba58c6c153bfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for tmb 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.