![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
pyptv3 is a Python library that provides a light wrapper around version 3 of the Public Transport Victoria (PTV) API.
The PTV Timetable API provides direct access to Public Transport Victoria’s public transport timetable data.
The API returns scheduled timetable, route and stop data for all metropolitan and regional train, tram and bus services in Victoria, including Night Network(Night Train and Night Tram data are included in metropolitan train and tram services data, respectively, whereas Night Bus is a separate route type).
The API also returns real-time data for metropolitan train, tram and bus services (where this data is made available to PTV), as well as disruption information, stop facility information, and access to myki ticket outlet data.
You will need a developer key from PTV. The instructions (in RTF format) are here, though if you can't be bothered downloading that, the TL;DR is to send an email to APIKeyRequest@ptv.vic.gov.au with the following information in the subject line of the email.
pip install pyptv3
All API endpoints require a client object to be setup first. The client object takes your developer id and api key as arguments.
from pyptv3 import Client
client = Client("your developer id", "your api key")
As a general rule, required path parameters are passed as positional arguments, and optionals are passed as lists. See the swagger documentation for more information.
from pyptv3 import Client, Departures
client = Client("your developer id", "your api key")
departures = Departures(client, 0, 1341).by_route(4122, platform_numbers=[0, 1], direction_id=1, look_backwards=False, gtfs=123, date_utc="2018-06-28T07:00:00Z", max_results=10, include_cancelled=True, expand=["stop", "route"])
print(departures)
There is a Async IO client if you want non-blocking behaviour
import asyncio
from pyptv3 import AsyncClient, Departures
loop = asyncio.get_event_loop()
client = AsyncClient(loop, "your developer id", "your api key")
def main():
departures = await Departures(client, 0, 1341).by_route(4122, platform_numbers=[0, 1], direction_id=1, look_backwards=False, gtfs=123, date_utc="2018-06-28T07:00:00Z", max_results=10, include_cancelled=True, expand=["stop", "route"])
print(departures)
loop.run_until_complete(main())
loop.close()
FAQs
Access the Public Transport Victoria API with Python 3
We found that pyptv3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.