Skip to main content

atm-milano

Async client for ATM Milano (GiroMilano) with pydantic models. Unofficial; endpoints may change.

pip install atm-milano

API (AtmClient)

Method Returns Description
search_places(term, kinds=, limit=) SearchResults Addresses, localities, POIs (stations, stops)
geocode(place) Place Add coordinates to an address result
resolve_place(ref) Place Text, Place or (lat, lng) → place with coordinates
plan_trip(origin, destination, when=, modes=) TripPlan Public-transport trips (default: now, Europe/Rome)
get_line_route(line, direction=0) LineRoute Ordered stops of a line (M1..M5, 90, 15...)
get_stop_lines(stop_code) StopLines Lines at a stop with live wait times
get_stop_timetable(stop_code, line, direction=0) Timetable Scheduled times by day type and hour
list_metro_stations(line=None) list[MetroStation] Metro stations (Comune di Milano GIS)

Errors: AtmError → AtmBlockedError, AtmNotFoundError, AtmApiError.

Examples

import asyncio
from datetime import datetime
from atm_milano import AtmClient, TransportMode


async def main():
    async with AtmClient(lang="en") as c:
        places = await c.search_places("Cadorna")
        print(places.places[0].name, places.places[0].code)

        plan = await c.plan_trip(
            "Cadorna",
            "Stazione Centrale",
            when=datetime(2026, 11, 20, 9, 30),
            modes=[TransportMode.METRO],
        )
        trip = plan.trips[0]
        print(trip.duration_minutes, "min", [s.description for s in trip.steps])

        route = await c.get_line_route("M1", direction=0)
        print(route.description, len(route.stops), "stops")

        stop = await c.get_stop_lines("-51")  # Cadorna M1
        print([(a.line_code, a.wait) for a in stop.arrivals])

        tt = await c.get_stop_timetable("12254", "1")  # tram 1 at Greco Rovereto
        print(tt.schedules[0].day_type)

        print(len(await c.list_metro_stations("M2")), "M2 stations")


asyncio.run(main())

Origins/destinations accept free text, a Place, or a (lat, lng) tuple.

Metadata

Release files for atm-milano 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atm-milano 0.1.2
File Size Uploaded Provenance Actions
atm_milano-0.1.2.tar.gz 19.6 kB With provenance Details for atm_milano-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for atm-milano 0.1.2
File Interpreter ABI Platform Actions
atm_milano-0.1.2-py3-none-any.whl Python 3 none any Details for atm_milano-0.1.2-py3-none-any.whl

Total release size: 31.5 kB

Release files / atm_milano-0.1.2.tar.gz

Download URL atm_milano-0.1.2.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e6ee3d37a703abd43be66d873ce3fecc58e7d23704ddfa2d0b0b1abc972c9135
BLAKE2b-256 checksum
How to use checksums
d64759890435938475c6e9c9b0a0a2ef02543db4a9b2bfbde56f6fb3d0d549a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / atm_milano-0.1.2-py3-none-any.whl

Download URL atm_milano-0.1.2-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c0ab213338dff89476a9b12b6ede6864732fc2db12ea29abf91ecd92fd6ef7b
BLAKE2b-256 checksum
How to use checksums
e72dea6de1609ab73fd3ef2ee9fed8d2c5fb9c9daacc93ca48bd828f94184cc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for atm-milano 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for atm_milano-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page