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.1

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.1
File Size Uploaded Provenance Actions
atm_milano-0.1.1.tar.gz 19.6 kB With provenance Details for atm_milano-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 31.5 kB

Release files / atm_milano-0.1.1.tar.gz

Download URL atm_milano-0.1.1.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
71ff5c08ee2dfc3b95cee90d68143eaafe3381929da3a5777431413844662bc3
BLAKE2b-256 checksum
How to use checksums
216f1e6959c61e2e5994b81fe9348bf29054217db6082caa67a08219456d462f
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.1-py3-none-any.whl

Download URL atm_milano-0.1.1-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ea52ff865ec5f30c4638b0630f6d88b3739a1e87342325d7a5cd89ee36d4e4a
BLAKE2b-256 checksum
How to use checksums
7dd742d6c64dd047fb432687ea1b61eea47bf5295a18bd3bec5681daeb5b2d58
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.1

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.1.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