Skip to main content

Viaggiatreno API wrapper to use with Home Assistant.

Project description

This package is designed to query the Trenitalia ViaggiaTreno API (that are mostly undocumented, but see here, in Italian) in a Home Assistant integration.

from viaggiatreno_ha.trainline import (Viaggiatreno,
                                       TrainLine,
                                       TrainLineStatus)
from aiohttp import ClientSession


async def main():
    async with ClientSession() as session:
        vt = Viaggiatreno(session)
        tl = TrainLine('S01765', '136')
        await vt.query_if_useful(tl)
        ts = TrainLineStatus(vt.json[tl])
        print(ts)

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

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

viaggiatreno_ha-0.1.7.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

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

viaggiatreno_ha-0.1.7-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file viaggiatreno_ha-0.1.7.tar.gz.

File metadata

  • Download URL: viaggiatreno_ha-0.1.7.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for viaggiatreno_ha-0.1.7.tar.gz
Algorithm Hash digest
SHA256 0711badd2f7ffe874e13def85ea5c4828f01dbe2a2ea10b9da1028e21ccad8d0
MD5 b51a8bcd6d47f98d1a36ef80621ca141
BLAKE2b-256 4afdf36c23d9c847dda0b37a9b3db3af1b4cd2f13f83c3953ba4930e64943b17

See more details on using hashes here.

Provenance

The following attestation bundles were made for viaggiatreno_ha-0.1.7.tar.gz:

Publisher: python-publish.yml on monga/viaggiatreno_ha

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file viaggiatreno_ha-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for viaggiatreno_ha-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4222cf89d1b15314948c2192c502ea42d76ff6c055604fd3b92af692c07a0ffe
MD5 f7b4c44f800cf7328ccefce2134184cd
BLAKE2b-256 404a66df101dde80ef7d11d59cc1ff3c0ddda32db9035a9970c632912a08663b

See more details on using hashes here.

Provenance

The following attestation bundles were made for viaggiatreno_ha-0.1.7-py3-none-any.whl:

Publisher: python-publish.yml on monga/viaggiatreno_ha

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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