Skip to main content

Un paquete de Python para obtener datos de Metrovalencia usando MetroAPI, la API no oficial.

Project description

Picture

metrovalencia-py

GitHub stars GitHub release

Un paquete de Python para obtener datos de Metrovalencia usando MetroAPI, la API no oficial.

panel APIdocumentacióndocumentación MetroAPI

Inicio rápido

from metrovalencia import MetroValencia

metro = MetroValencia(
    app_name="miapp",
    contact="dev@ejemplo.com"
)

previsiones = metro.previsiones.get("Alameda")
for p in previsiones.previsiones:
  print(f"L{p.line} {p.destino}: llega en {p.seconds}s")

result = metro.paradas.buscar("Marítim")
print(f"Encontrado {len(result.paradas)} paradas")
for p in result.paradas:
  print(p)

ruta = metro.rutas.rutap("Colón", "Bailén")
print(f"Tiempo entre Colón y Bailén: {ruta.tiempo_total_minutos:.2f} minutos.") 
print(f"Tiempo entre paradas: {ruta.ruta[len(ruta.ruta) - 1].segundos_acumulados - ruta.ruta[0].segundos_acumulados} segundos")

metro.close()

Documentación

Puedes ver la documentación en repo/docs/README.md.

Datos

Puedes elegir el formato de las respuestas usando response_type. Hay tres opciones:

  • class (por defecto): Datos en dataclasses
  • json: Respuesta exacta del servidor.
  • parsed_json: JSON pero más limpio (se quitan los null y se utiliza snake_case).
metro = MetroValencia(
    app_name="miapp",
    contact="dev@ejemplo.com",
    response_type="class"  # por defecto
)

¿Qué puedes hacer?

  • Puedes ver previsiones o el estado de las paradas
  • Ver las incidencias de transporte o accesibilidad
    • Ver incidencias v2, en pruebas, basadas en los Tweets y Incidencias de la API, categorizadas con IA.
  • Ver información de tarjetas de metro
  • Hacer rutas entre dos paradas
  • Información, como las tarifas, zonas
  • Obtener las noticias de metrovalencia

Historial de Estrellas

Star History Chart

Licencia

MIT

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

metrovalencia-0.1.1.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

metrovalencia-0.1.1-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file metrovalencia-0.1.1.tar.gz.

File metadata

  • Download URL: metrovalencia-0.1.1.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for metrovalencia-0.1.1.tar.gz
Algorithm Hash digest
SHA256 be5d7e4c65b1ba607e365e26bac1a58300b633bbd25704c24a3f1de61d04585c
MD5 448e02bc8eeed2cfcfeea3a679853a1c
BLAKE2b-256 f91355bf73b0c49daadf9b3524cecf9a3f344c0dcbab6376f9be542db8a9a9ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrovalencia-0.1.1.tar.gz:

Publisher: publish.yml on sayborduu/metrovalencia-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metrovalencia-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: metrovalencia-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for metrovalencia-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8f1d775d42b616c2ff7d1f44f87c6f9df81b21b3fcef60d15df3be3b3067245b
MD5 1d0e58e78736c1c9df289289afb2be63
BLAKE2b-256 e08588444980336c0d94c89f9ccd85992792a243fcdac5fd2e20dc30662b55f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrovalencia-0.1.1-py3-none-any.whl:

Publisher: publish.yml on sayborduu/metrovalencia-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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