Skip to main content

A simple Python library for accessing CFL P+R APIs (https://www.cfl.lu/fr-fr/app/parkandride)

Project description

cflpr

Asynchronous Python client for the CFL Park&Ride mobile API. It handles authentication, token refresh, and helpers for fetching Park&Ride availability and ticket information.

Installation

pip install cflpr

Usage

import asyncio
from cflpr.api import CFLPRAPI

def handle_refresh_token(token: str) -> None:
    print(f"New refresh token: {token}")

async def main() -> None:
    async with CFLPRAPI(refresh_token_listener=handle_refresh_token) as api:
        await api.authenticate("your-email@example.com", "your-password")
        tickets = await api.get_closed_tickets()
        for ticket in tickets:
            print(ticket)

if __name__ == "__main__":
    asyncio.run(main())

CFLPRAPI maintains the authenticated aiohttp session for you and refreshes access tokens automatically when they are about to expire. Attach a refresh_token_listener if you need to persist new refresh tokens.

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

cflpr-0.0.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cflpr-0.0.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file cflpr-0.0.1.tar.gz.

File metadata

  • Download URL: cflpr-0.0.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for cflpr-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d5ee241c43edc5d539d1c9f4493e54f28a828d0033e3bebf3a43ff073fd0a824
MD5 a266fc15b20abb4c812f9fd5a2c36f18
BLAKE2b-256 7506c37e5210e4524aefe99599dab1100d4526f62067a97fcb2612b566d6cabe

See more details on using hashes here.

File details

Details for the file cflpr-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: cflpr-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for cflpr-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2244100394f6800034e59bca3da9b2f52d68464d4feae911aaa541c8c6ffe511
MD5 0bd2e0faf90ac98d32f501bdbbdf6e05
BLAKE2b-256 df109c9340526bdb1f319c7fbf6096652b8b46068939a9d97e8ede49fae26d5f

See more details on using hashes here.

Supported by

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