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

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

Built distribution (wheel)

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

Total release size: 31.5 kB

Release files / atm_milano-0.1.3.tar.gz

Download URL atm_milano-0.1.3.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b8b909a6644aa009de4ea02739d609c14e0f6beda7dc1476c9af1bf04edf2397
BLAKE2b-256 checksum
How to use checksums
43f13e0a671d9ab0f395031469385cd038903d27a8c2a47f454384ec2f0a06fd
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.3-py3-none-any.whl

Download URL atm_milano-0.1.3-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5804f50d392e1f22a9a2af6db61e2c67c1c71c76a075badddd34607e5fea26b1
BLAKE2b-256 checksum
How to use checksums
4e92856b81d01def2dcbf1e5bf794ff124f661ce80029db1ff49d12a97711d56
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.3

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