Giter Club home page Giter Club logo

python_vigobusapi's Introduction

Python VigoBusAPI

Intermediate Python + FastAPI API that provide Stop and Bus information provided by the public transport system of the city of Vigo (Galicia/Spain).

The goal of this API is to keep the different data sources and APIs available on one single API with better endpoints structure and more clear data output format (as JSON).

The API can output Stop information and real-time lists of Buses coming to a certain Stop, with their remaining time in minutes.


API intermedia basada en Python + FastAPI que provee informaci贸n de Paradas y Autobuses para el sistema de transporte p煤blico de la ciudad de Vigo (Galicia/Espa帽a).

El objetivo de esta API es unificar las diferentes fuentes de datos y APIs disponibles en una s贸la API con mejor estructura de endpoints y una salida de datos con un formato m谩s claro (como JSON).

La API puede devolver informaci贸n de Paradas y listados en tiempo real de los Autobuses que pasar谩n por una Parada concreta, con su tiempo restante en minutos.

Features

  • API powered by FastAPI, offering a REST API focused web server, fully async and auto-generating documentation.
  • Nice-looking, human-readable & easily-parseable endpoint response output as JSON, compared with original data sources.
  • Local data storages: Stop cache, Stop MongoDB, Buses cache; to reduce requests to the external API/data sources.
  • Original API/data source fixes in Stop names and Buses lines/routes.
  • Environment variables / DotEnv file - based settings system.

  • API basada en FastAPI, que ofrece un servidor web orientado a API REST, as铆ncrono y que auto-genera documentaci贸n.
  • Respuestas formateadas como JSON, con mejor estructura, legibles, coherentes y f谩cilmente procesables, en comparaci贸n con los resultados de las fuentes originales.
  • Sistemas de almacenamiento local: cach茅 de Paradas, base de datos MongoDB de Paradas, cach茅 de Autobuses; para as铆 reducir las peticiones a las API/fuentes de datos externas.
  • Arreglo de nombres de Paradas y l铆neas/rutas de Autobuses en los datos devueltos por las API/fuentes de datos originales.
  • Sistema de configuraci贸n basado en variables de entorno / archivo DotEnv.

Requirements


Endpoints

  • /stop/<stop_id> : Get information about a Stop (name, location), given the Stop ID
  • /buses/<stop_id> : Get the Buses that will arrive to a Stop, given the Stop ID
  • /stops?stop_name=<name> : Search stops by name
  • /nearstops/<lat>/<lon> : Get the Stops available near the given location (latitude and longitude) (WIP)
  • /docs : Swagger UI (documentation) auto-generated by FastAPI

  • /stop/<stop_id> : Informaci贸n de una Parada (nombre, ubicaci贸n), dado un c贸digo de parada
  • /buses/<stop_id> : Autobuses que pasar谩n por una parada, dado su c贸digo de parada
  • /stops?stop_name=<name> : Buscar paradas por nombre
  • /nearstops/<lat>/<lon> : Paradas cercanas a una ubicaci贸n, dadas sus coordenadas geogr谩ficas (latitud, longitud) (WIP)
  • /docs : Documentaci贸n Swagger UI auto-generada por FastAPI

Changelog

  • 0.8.0 - add new online data source for buses; dotenv settings refactor
  • 0.7.1 - set Mongo stop name text index language to spanish
  • 0.7.0 - add limit query param to search stops endpoint
  • 0.6.1 - add unit tests; fix clear_duplicated_buses function by simplifying logic
  • 0.6.0 - add endpoint to search stops by name; get buses extra pages asynchronously
  • 0.5.0 - refactor request & error handling, imports & cache; add logging
  • 0.4.0 - remove WSDL data sources
  • 0.3.3 - remove dotenv-settings-handler as dependency and use pydantic only; remove not required settings; freeze requirements versions
  • 0.3.2 - fix buses endpoint returning null source; remove setup.py
  • 0.3.1 - store StopNotExist status on local Stop cache
  • 0.3.0 - define data models on project (deprecate pybusent)
  • 0.2.2 - fix cache bus getter, was returning full list of buses when requesting a minimal list but a full list was cached
  • 0.2.1 - fix Stops endpoint, return empty array if no buses available
  • 0.2.0 - Migrated to FastAPI, new features, using MongoDB as local storage
  • 0.1.0 - Initial release

  • 0.8.0 - a帽adida nueva fuente de datos online para buses; refactorizaci贸n de configuraciones .env
  • 0.7.1 - establecer idioma spanish en text index de paradas guardadas en Mongo
  • 0.7.0 - query param para limitar resultados en endpoint de buscar paradas por nombre
  • 0.6.1 - tests unitarios; arreglada funcin贸n clear_duplicated_buses simplificando l贸gica
  • 0.6.0 - endpoint para buscar paradas por nombre; leer p谩ginas extra de buses as铆ncronamente
  • 0.5.0 - refactorizaci贸n de request y error handling, imports y cache; a帽adir sistema de logs
  • 0.4.0 - quitar fuentes de datos WSDL
  • 0.3.3 - quitar la dependencia dotenv-settings-handler y usar s贸lo pydantic; borrar configuraciones no necesarias; congelar versiones de requirements
  • 0.3.2 - fix endpoint buses devolviendo source null; borrar setup.py
  • 0.3.1 - guardar estado StopNotExist en cach茅 local de Stops
  • 0.3.0 - definici贸n de modelos de datos en proyecto (sin usar pybusent)
  • 0.2.2 - fix cache bus getter, devolv铆a listado completo de buses cuando se ped铆a un listado parcial pero uno completo estaba almacenado
  • 0.2.1 - fix endpoint Stops, devolver array vac铆o si no hay autobuses disponibles
  • 0.2.0 - Migrado a FastAPI, nuevas caracter铆sticas, usando MongoDB como almacenamiento local
  • 0.1.0 - Release inicial

TODO

  • Improve Swagger/OpenAPI documentation
  • Add static route information endpoints
  • Add Near Stops endpoint
  • Add more tests
  • Add detailed install & configuration instructions
  • Use new data source to get Stop data

  • Mejorar la documentaci贸n de Swagger/OpenAPI
  • A帽adir endpoint para consulta de rutas est谩ticas
  • A帽adir endpoint para consulta de paradas cercanas a ubicaci贸n
  • A帽adir m谩s tests
  • A帽adir instrucciones detalladas de instalaci贸n y configuraci贸n
  • Usar la nueva fuente de datos para obtener datos de paradas

Disclaimer

This project is not endorsed by, directly affiliated with, maintained by, sponsored by or in any way officially connected with the company or companies responsible for the public transport service of the city of Vigo.


Este proyecto no cuenta con soporte, no est谩 afiliado con, mantenido por, patrocinado por ni en cualquier otra manera oficialmente conectado con la compa帽铆a o compa帽铆as responsables del sistema de transporte p煤blico de la ciudad de Vigo.

python_vigobusapi's People

Contributors

david-lor avatar dependabot[bot] avatar lodeiro0001 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    馃枛 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 馃搳馃搱馃帀

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google 鉂わ笍 Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.