Skip to main content

Python library to retrieve data from Grand Lyon open data platform, for Home Assistant.

Project description

data_grand_lyon_ha

Python library to retrieve data from the Grand Lyon open data platform.

Intended for use as a Home Assistant integration backend.

Installation

pip install data-grand-lyon-ha

Or with uv:

uv add data-grand-lyon-ha

Usage

import asyncio
import aiohttp
from data_grand_lyon_ha import DataGrandLyonClient, TclPassageType

async def main():
    async with aiohttp.ClientSession() as session:
        client = DataGrandLyonClient(session)
        # Or with authentication:
        # client = DataGrandLyonClient(session, username="user", password="pass")

        # Passages for a specific line, stop, and type
        passages = await client.get_tcl_passages("A", 30101, TclPassageType.THEORETICAL)
        for p in passages:
            print(f"{p.ligne}{p.direction} in {p.delai_passage}")

        # All passages for a stop (all lines and types)
        all_passages = await client.get_tcl_stop_passages(30101)
        for p in all_passages:
            print(f"{p.ligne}{p.direction} in {p.delai_passage} [{p.type}]")

asyncio.run(main())

Development

This project uses uv for dependency management.

# Run tests
uv run pytest

# Build the package
uv build

License

MIT

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

data_grand_lyon_ha-0.7.0.tar.gz (693.9 kB view details)

Uploaded Source

Built Distribution

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

data_grand_lyon_ha-0.7.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file data_grand_lyon_ha-0.7.0.tar.gz.

File metadata

  • Download URL: data_grand_lyon_ha-0.7.0.tar.gz
  • Upload date:
  • Size: 693.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for data_grand_lyon_ha-0.7.0.tar.gz
Algorithm Hash digest
SHA256 8097ac776c5d9caf4574aaad861088f8323dbebf28ed395d5b50fcb3369e3a9f
MD5 bfe9247200544a511ac4eef43e29f233
BLAKE2b-256 a05ff0f0cd1b1300776557beaad5f90d8e97318cb2a6e47e1fbf4e79ca4faf23

See more details on using hashes here.

File details

Details for the file data_grand_lyon_ha-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: data_grand_lyon_ha-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for data_grand_lyon_ha-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f31b272ec5ac55f013a98c5495afb015ae1148d97da8fb5735b85a9648c1da5f
MD5 2f768018c15870395e3c6d2c9c2b03b8
BLAKE2b-256 d93a1524432b62937523a991909da348a6fee4e280a09de1fd2f434cf7f1595c

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