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.6.0.tar.gz (693.4 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.6.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: data_grand_lyon_ha-0.6.0.tar.gz
  • Upload date:
  • Size: 693.4 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.6.0.tar.gz
Algorithm Hash digest
SHA256 cb716baa880f01696c2de69fe3e4bec3561074afe797b3c72702e58bd8bb0bdc
MD5 e866cabd3b21821db33b68b3d2b34ce2
BLAKE2b-256 89f5d159db01f60c22b8a002ee03a70c8eab3de51fd0e23f5eb674a80045246b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: data_grand_lyon_ha-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 977f150e686fca0fa6ad20423dd0dd29cefbb5df9f2a601dc7b71893302b3a5c
MD5 0a59a1509a2ae9769b4a8263e2571c16
BLAKE2b-256 49723b0fa4c41d5555f2b928eb0ed37ba8347365281a244e04b3ec9b5ce65494

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