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.8.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.8-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: viaggiatreno_ha-0.1.8.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.8.tar.gz
Algorithm Hash digest
SHA256 c02f18b5618211e5217bc11882966a323652afde0e4249d30b909b2972f1b9b4
MD5 adb0c594239b16f85f586fb1f8421bc7
BLAKE2b-256 56c29740c545fead7fbe66e7eb2a7b90f574989aa6b622ed881cb6e00edb1d45

See more details on using hashes here.

Provenance

The following attestation bundles were made for viaggiatreno_ha-0.1.8.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.8-py3-none-any.whl.

File metadata

File hashes

Hashes for viaggiatreno_ha-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 77c6d39db59c3fabeed50eba6344e26e2b3ab26bd5a8098e881ba7f52791e132
MD5 374ae2d45b5dc1b88198e6a2b86d09cd
BLAKE2b-256 7f12e6cfab77087b7f674af681ba397584889e91aa9f5677a01bc87bb6608046

See more details on using hashes here.

Provenance

The following attestation bundles were made for viaggiatreno_ha-0.1.8-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