A Python package for the Transport for London (TFL) API.
Project description
A Python package for the Transport for London (TFL) API.
The TFL API is a RESTful API that provides data related to all modes of transport in London, including cycle hire, buses, roads, and the underground. Anonymous access to the TFL API is limited to 50 requests a minute. If you want to call the API more than that, you'll need to subscribe to a "Product" which lets you bypass this limit with a subscription-key that you append to your requests.
Currently, we support the following APIs:
The plan is to add support for all the TFL APIs. Contributions are welcome!
Installation
pip install py-tfl
or install with Poetry:
poetry add py-tfl
⚡️Quickstart
⌨️ CLI
The TFL CLI provides a command line interface to the TFL API. It is built on top of Typer, which provides easy way to build command line interfaces.
tfl --help
🦋 Client
The TFL client provides a Python interface to the TFL API. It provides a Pythonic interface to the API, and handles authentication and rate limiting for you. The client is built on top of HTTPX, which provides a fast, async HTTP client.
from tfl import clients
async with clients.LiftDisruptionsV2Client() as client:
response = await client.get_lift_disruptions()
print(response.json())
📈 Releases
You can see the list of available releases on the GitHub Releases page.
We follow Semantic Versions specification.
We use Release Drafter
. As pull requests are merged, a draft
release is kept up-to-date listing the changes, ready to publish when you’re ready. With the categories option, you can
categorize pull requests in release notes using labels.
🛡 License
This project is licensed under the terms of the MIT
license. See LICENSE
for more details.
🚀 Credits
A special thanks to HTTPX, Typer, and the TFL API team for making this project possible.
This project was built using IntelliJ IDEA.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file py_tfl-0.4.2.tar.gz
.
File metadata
- Download URL: py_tfl-0.4.2.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a9ffbd7cce22367d423fb0b5324ae2a6906f8a105578366cd44393d05dcc22a |
|
MD5 | baaad6f00f4634092c09b92ca1d00c33 |
|
BLAKE2b-256 | c2f95a83e8e4b612b80f2c8ca354e14fe9717124887972deda677681b90f9432 |
File details
Details for the file py_tfl-0.4.2-py3-none-any.whl
.
File metadata
- Download URL: py_tfl-0.4.2-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccb946d579a4d9b80fb461441d33acd2c30de9bef333d23bc73275196c853f61 |
|
MD5 | eb7e3ca4602b58adba5b1d76e580cfc7 |
|
BLAKE2b-256 | 810b6c894d16017804c7bcbb7d703818a832d247ad2dd53d3e5f41ff2c4421af |