Skip to main content

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

Project description

Picture

metrovalencia-py

Estrellas de GitHub Versión de GitHub Licencia

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.2.tar.gz (18.0 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.2-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: metrovalencia-0.1.2.tar.gz
  • Upload date:
  • Size: 18.0 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.2.tar.gz
Algorithm Hash digest
SHA256 f630fb08567160191183fdc507d613a388d2dfe2f0adf9d84d7af05e59222c6c
MD5 10da67016eb5852b6e2b59ea216c3149
BLAKE2b-256 d4580e9fe893f7dea53e796b63da191080a3a709221d0c2f81cc8d9f23b51b13

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrovalencia-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: metrovalencia-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 25.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c355c4221be22a77357c93e183ceb1d2dfb1b357280ecd2effec0be1c410966c
MD5 bb441daca50c92ebbf133d2b899dc0f5
BLAKE2b-256 16fec5480ebf7131514f2aa2324c2f7a3b078e3e98e80fda92cbd268f1cdb174

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrovalencia-0.1.2-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