Skip to main content

EMTVLC-API

Python module that retrieves bus times for a given stop and stops within an extent.

Data from EMT valencia.

pip

Module is available at PyPI and can be installed via pip:

pip install emtvlcapi

Usage

All methods return a list containing the results

Get bus times for a given stop id and optionally a bus number:

import emtvlcapi

# get bus times for stop 508
response = emtvlcapi.get_bus_times(508)
print(response)

# get bus times for stop 508 and line 93
response = emtvlcapi.get_bus_times(508, 93)
print(response)

Output:

[{'linea': '70', 'destino': 'Alboraia', 'minutos': '13'}, 
{'linea': '93', 'destino': 'Pass. Marítim', 'minutos': '15'}, 
{'linea': '93', 'destino': 'Pass. Marítim', 'minutos': '29'}, 
{'linea': '70', 'destino': 'Alboraia', 'minutos': '31'}, 
{'linea': 'N4', 'destino': 'Est.del Nord', 'horaLlegada': '22:41'}, 
{'linea': 'N4', 'destino': 'Est.del Nord', 'horaLlegada': '23:32'}]


[{'linea': '93', 'destino': 'Pass. Marítim', 'minutos': '14'}, 
{'linea': '93', 'destino': 'Pass. Marítim', 'minutos': '28'}]

Get stops within the rectangle created by 2 lat-lon points in opposite corners:

import emtvlcapi

response = emtvlcapi.get_stops_in_extent(39.471964, -0.394641, 39.474714, -0.405906)
print(response)

Output:

[{
	'lat': '39.4720832588597', 
	'lon': '-0.40559318566979', 
	'name': "Nou d'Octubre (par) - Democràcia", 
	'routes': [
		{'headSign': 'Tres Creus', 'id_linea': '73', 'LN': 'Tres Creus', 'SN': '73', 'type': 'A'}, 
		{'headSign': 'Hospital General', 'id_linea': '95', 'LN': 'Hospital General', 'SN': '95', 'type': 'A'}, 
		{...}
	], 
	'stopId': '2070', 
	'ubica': 'C NUEVE DE OCTUBRE 8 ACC - VALÈNCIA'
}, {
	...
}]

cli

The repo also includes a python cli with a working example

$ python -m emtvlcapi bus_times 508
Parada 508
	70 (Alboraia): 5 minutes left
	93 (Pass. Marítim): 13 minutes left
	70 (Alboraia): 22 minutes left
	93 (Pass. Marítim): 12:34
$ python -m emtvlcapi stops_in_extent 39.471964 -0.394641 39.474714 -0.405906
Paradas en [ 39.471964 , -0.394641 ; 39.474714 , -0.405906 ] ->

	2070 - Nou d'Octubre (par) - Democràcia
		LatLon: 39.4720832588597, -0.40559318566979
		Lineas:
			73 - Tres Creus
			95 - Hospital General
			98 - Av. del cid
			99 - la Malva-rosa
	
	...

Metadata

Release files for emtvlcapi 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emtvlcapi 1.0.0
File Size Uploaded Provenance Actions
emtvlcapi-1.0.0.tar.gz 42.7 kB Without provenance Details for emtvlcapi-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for emtvlcapi 1.0.0
File Interpreter ABI Platform Actions
emtvlcapi-1.0.0-py3-none-any.whl Python 3 none any Details for emtvlcapi-1.0.0-py3-none-any.whl

Total release size: 72.6 kB

Release files / emtvlcapi-1.0.0.tar.gz

Download URL emtvlcapi-1.0.0.tar.gz
Size 42.7 kB
Tags Source
SHA-256 checksum
How to use checksums
36b566195b3042f4c74b682787205abd5488654ed8394db21084f9c50caf5c19
BLAKE2b-256 checksum
How to use checksums
0803eaf3e2280a8f187f01e58a19e465daa4d5685e803db721d8ce13ff4249a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / emtvlcapi-1.0.0-py3-none-any.whl

Download URL emtvlcapi-1.0.0-py3-none-any.whl
Size 29.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e28429e46344b322029b72305fa64f78e8d60a159ec577d56d8938e1c8fbf69
BLAKE2b-256 checksum
How to use checksums
6e8e4871673521a6da9292fbe301f2a18678c1665dde7525122ec9543371cbc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Security for emtvlcapi 1.0.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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