An agent-friendly command-line interface for TPER public transport in Bologna and Ferrara: live buses, fares, zones, news and complaints (unofficial).
tper is a command-line interface for the public transport of Bologna and Ferrara run by TPER (Trasporto Passeggeri Emilia-Romagna). It is meant for AI agents (Claude Code, Gemini CLI, Codex, scripts) and for people who want a bus time, a train delay, a fare or a piece of news without opening an app. You can see when the next bus arrives, follow a train and its delay, find stops and lines, work out how many fare zones a trip crosses, compare tickets and passes, read service news, check rail disruptions and send a complaint. Output is predictable JSON, and complaints go through safety rails.
It speaks only to official public sources: the Hello Bus web service, TPER's open data, its RSS feeds, its zone calculator and complaint form, RFI's live station boards and Trenitalia's public disruption notices. No account and no API key are needed.
Unofficial. Not affiliated with or endorsed by TPER or Trenitalia. TPER and its logo are trademarks of their owners.
$ tper bus arrivals 4476 LINE TYPE TIME IN MIN BUS WHEELCHAIR 11B realtime 19:41 8 1638 yes 11B realtime 19:53 20 5753 yes $ tper rail board "bologna centrale" --carrier tper -n 4 TRAIN CATEGORY CARRIER TO/FROM TIME DELAY PLAT. STATUS 17709 REG TRENITALIA TPER PIANORO 19:46 20 3 delayed 90035 REG TRENITALIA TPER BAZZANO (FER) 19:53 0 3-OVEST onTime ... $ tper rail train 17709 -f json {"found":true,"train":"17709","carrier":"TRENITALIA TPER","destination":"PIANORO","time":"19:46","expectedTime":"20:06","delayMinutes":20,"status":"delayed","platform":"3","stops":[{"station":"BOLOGNA S.VITALE","time":"19:50"},...],"station":"Bologna Centrale","board":"departures"} $ tper fare quote --from Bologna --to "San Giovanni in Persiceto" --profile under27 3 zone(s), bologna price list, profile under27 KIND NAME ZONES PROFILE PRICE € PER RIDE single Single ticket 3 ordinary 3.7 single_onboard Single ticket bought on board (coins / driver) 3 ordinary 4.5 carnet10 10-ride carnet 3 ordinary 30.0 3.0 monthly Monthly pass (personal) 3 under27 47.0 annual Annual pass (personal) 3 under27 397.0 $ tper fare compare --urban bologna --days-per-week 5 --profile under27 cheapest: Annual pass (personal) at 19.17 EUR/month OPTION PROFILE € / MONTH HOW Annual pass (personal) under27 19.17 230.00 / 12 months Annual pass (transferable) ordinary 28.33 340.00 / 12 months Monthly pass (transferable) under27 30.0 flat monthly price ... $ tper bus arrivals 4476 -l 11 -f json {"arrivals":[{"line":"11B","type":"realtime","time":"19:41","bus":"1638","wheelchair":true,"minutes":8}],"stop":"4476","stopName":"LAPIDARI","mode":"realtime","fetchedAt":"2026-10-22T19:33:13+02:00","source":"TPER Hello Bus"} Features Live buses. Real-time arrivals from TPER's own GPS data (tper bus arrivals), or the timetable for a given time with --at 18:30. Stops by code or by name: a name that matches several stops is answered with the candidates instead of a guess. Trains. tper rail board STATION shows the live departures or arrivals of a station with delay, platform and carrier (Trenitalia Tper, Trenitalia, Italo…), and tper rail train NUMBER follows one train: expected time, platform and next stops. Data comes from RFI's live station boards. Stops and lines. Search stops with accent- and typo-tolerant matching, find the stops near a point, see which lines serve a stop and the nearest ticket retailer. Fares you can trust. The number of zones of a trip comes from TPER's own zone calculator; prices come from the official price list (Bologna, Ferrara and Imola urban networks, extra-urban zones 1 to 10, Ferrobus). Reduced prices for under 27, over 65 and over 70. Which ticket is cheapest. tper fare compare weighs single tickets, carnets, day tickets, monthly and annual passes against how much you travel, and tells you the break-even point. News and infomobility. TPER's RSS feeds (Bologna, Ferrara, rail, Corrente, parking) merged, filterable by line and date, and Trenitalia's disruption and works notices for the region. Rail reference data. The FER railway lines and stations with their fare zones. Complaints. Store your details once, then file a reclamo through TPER's own web form from the terminal, with a preview, a confirmation step and duplicate protection (experimental, see docs/claims.md). Agent-friendly: JSON when piped --fields to trim output stable exit codes JSON errors with hints tper schema introspection a ready-made agent skill and a Claude Code plugin Install Requires Python 3.11+. The only dependencies are click, requests and defusedxml.
pipx install tper-cli # or: uv tool install tper-cli # development version: pipx install git+https://github.com/lore2601/tper-cli tper doctor # checks every online service the CLI uses The first command that needs the open data downloads it (about 3 MB) into the cache; tper data update refreshes it. Nothing else to set up: see docs/setup.md for the optional config file and the complaint profile.
Run tper COMMAND --help for every option. Global options (-f, --fields, --debug) go before the command: tper -f table bus arrivals 4476.
Details, including what was deliberately left out, are in docs/data-sources.md. Output derived from the open data carries a source field with the attribution the licence asks for.
Almost everything is read-only. The one action that sends data to someone else, filing a complaint, is guarded:
Every argument is validated before it reaches a URL or a form, and the HTTP layer only talks to a short allowlist of TPER and Trenitalia hosts (also across redirects). Text from news and notices is third-party content: the agent skill tells agents to treat it as data.
See docs/agents.md for permission rules and recipes.
Issues and PRs are welcome: see CONTRIBUTING.md. Report security issues privately (SECURITY.md).
Apache-2.0. Open data © Tper S.p.A., CC BY 3.0 IT.
All 2 files in this release have provenance metadata.
agents bologna bus claude-code cli emilia-romagna ferrara hellobus public-transport tper
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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 verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
All 2 files in this release have been uploaded with provenance metadata.
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.




