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():
    """Example of use."""
    async with ClientSession() as session:
        vt = Viaggiatreno(session)
        tl = TrainLine('S01765', '136')
        await vt.query_if_useful(tl)
        print(vt.get_line_status(tl))

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: viaggiatreno_ha-0.2.1.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.2.1.tar.gz
Algorithm Hash digest
SHA256 1822f5db82931a9ad82ad354c3563457b31b6a2aee4eb2352e19a5c7bd67e958
MD5 031f55366460fbff588d2f808d2b3ba8
BLAKE2b-256 fbf109f948a2d16387d7a9c12e9ff7c9c905dfb3a1548c5523b905db7d30cd63

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for viaggiatreno_ha-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d0b278cbbf3d21f5e3d1f38ee76591930de473cefea51c077fde2b5adc4e4e7
MD5 0f4f3458010d9cb193489c872ac2083c
BLAKE2b-256 3904f4c66a654a3ce25ecbf1cbe1286278c7c200dd34b9ac46469b7dda8c7f33

See more details on using hashes here.

Provenance

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