Skip to main content

Unofficial API to retrieve STCP information for public transit buses in Porto, Portugal

Project description

STCP API

Unofficial API to retrieve STCP information for public transit buses in Porto, Portugal.

Retrieves static data about routes, stops, locations, and real-time estimates of bus arrivals.

Since it's based on a non-official API, it may stop working in the future. Confirmed working as of 1 December 2025.

See the files at stcp/routes.py, stcp/stops.py and stcp/util.py for the complete documentation, and examples.md for usage examples.

Available operations

Routes

Function Description
get_routes list of all STCP routes.
get_route_directions list of directions (usually 2) of a route.
get_route_stops list of all stops of a route in a direction.
get_route_services the service days of a route.
get_route_schedule schedule of a route in a direction.
get_route_real_time all buses running on a given route and their next stop.

Stops

Function Description
get_stops list of all stops.
get_stop_data data about a stop and its routes
get_stop_schedule schedule of stop
get_stop_real_time real-time list of buses passing through a stop soon (up to one hour from the current time).

Utilities

Function Description
get_route_data combines route_directions, route_stops in all directions, and route_services .
get_stop_route_departures gets a map of upcoming departures of a stop, grouped by route.
get_full_route_times gets the current times for a given route.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stcp_api-2.0.2.tar.gz (43.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stcp_api-2.0.2-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file stcp_api-2.0.2.tar.gz.

File metadata

  • Download URL: stcp_api-2.0.2.tar.gz
  • Upload date:
  • Size: 43.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for stcp_api-2.0.2.tar.gz
Algorithm Hash digest
SHA256 04f7e548b246fa1442f10d106060ccddee4ad1345b4dcf6aabfe6a12f26a448d
MD5 a6b5c788628a470f2c3e09db8447b1e4
BLAKE2b-256 0b205c7d2e0f71db5c48e3dcb89adcf63f09e8c3acd3daf3de6b5b11e1760fc6

See more details on using hashes here.

File details

Details for the file stcp_api-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: stcp_api-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for stcp_api-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ba05b1888f20af0be2d86c70899b8fc491563482e68077b3a6553c6e953d3c2b
MD5 ed48a8c23cb2db6dedfd0310543f75e2
BLAKE2b-256 c93d51ebfe23d18f0f47d7817be3b32f79bbdb4ea0e55f3b5dbda0493fdfe703

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page