Skip to main content

A Python package for the Transport for London (TFL) API.

Project description

tfl

TFL-Image.jpg

Python Code style: black Checked with mypy Ruff Pre-commit Semantic Versions Code Stability Unit Tests codecov CodeFactor

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, this package only supports the Lift Disruptions API. However, the plan is to add support for all the TFL APIs. Contributions are welcome!

Installation

poetry install

⚡️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.

poetry run 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())

🛡 License

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.

JetBrains Black Box Logo logo

Project details


Download files

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

Source Distribution

py_tfl-0.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

py_tfl-0.1.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file py_tfl-0.1.0.tar.gz.

File metadata

  • Download URL: py_tfl-0.1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for py_tfl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1ecb81cc0ca964d7feeef3e18d0af8b3467535a9d3bacae502abdb69120f0847
MD5 d77cc7e91033f17f8258bcf3036b3e9a
BLAKE2b-256 46aa9db55bee725977d13baa35f22ee25b6f304634c683935121a781eac2494b

See more details on using hashes here.

File details

Details for the file py_tfl-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: py_tfl-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for py_tfl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 013e006fd5aee142582935845f2b5e77b46ccb3413de554853b957a7a9d62bc3
MD5 ef0f0cf1445635630be46d587272b304
BLAKE2b-256 250d500d03b5b3111073a50bf868db35d889256e453115f1ddc4e51d9a710d4c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page