Metadata-Version: 2.4
Name: cflpr
Version: 0.0.1
Summary: A simple Python library for accessing CFL P+R APIs (https://www.cfl.lu/fr-fr/app/parkandride)
Home-page: https://github.com/adetante/python-cflpr
Author: adetante
License: MIT
Keywords: CFL,P+R,PARKING
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.12.1
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# 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

```bash
pip install cflpr
```

## Usage

```python
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.
