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.5.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.5.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: data_grand_lyon_ha-0.5.0.tar.gz
  • Upload date:
  • Size: 693.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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.5.0.tar.gz
Algorithm Hash digest
SHA256 9c085c8fdda76d35f8226512048db04fea8dec6344b4c30b67fe1af0451a063c
MD5 02864816b75abeec43f6ba717804478f
BLAKE2b-256 c0bdadb2d21870fa9abd55b185eaf48ee5f04a68720a38b2ab60cee29c1830af

See more details on using hashes here.

File details

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

File metadata

  • Download URL: data_grand_lyon_ha-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39cc28dafbcdaefb6e1837494832300e6fc183f72a20879186216345ca64609a
MD5 eb2250056f4bbe728d65d0581d557e24
BLAKE2b-256 d672b6fc0cdbec2b483496abc6885e8b359b330b6f9b3650ab03aa42e42189c5

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