Skip to content

Commit

Permalink
Merge pull request #27 from David-Lor/develop
Browse files Browse the repository at this point in the history
0.9.0 to master
  • Loading branch information
David-Lor authored Feb 5, 2022
2 parents 06318d2 + 40db5a6 commit f77f7d6
Show file tree
Hide file tree
Showing 22 changed files with 1,025 additions and 90 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/export-openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Export OpenAPI schema
on:
- push
- workflow_dispatch

jobs:
export_openapi:
name: Export OpenAPI schema & commit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: "3.8"
architecture: "x64"
- name: Setup requirements
run: "pip install -r requirements.txt && pip install pyyaml==5.4.1"
- name: Export schema to JSON and YAML files
run: "python tools/export-openapi.py docs/openapi.json docs/openapi.yaml"
- name: Commit & Push exported schemas
# https://github.com/marketplace/actions/add-commit
uses: EndBug/add-and-commit@v7
with:
add: "docs/openapi.*"
message: "Update OpenAPI"
pull_strategy: "NO-PULL"
push: true
19 changes: 19 additions & 0 deletions .github/workflows/update-license-year.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Update year in license file"
on:
workflow_dispatch: {}
schedule:
- cron: "0 3 1 1 *" # January 1st, 3:00 AM

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: "Checkout"
with:
fetch-depth: 0
- uses: FantasticFiasco/action-update-license-year@v2
name: "Update year in license file"
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: "LICENSE.md"
108 changes: 108 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Changelog

## 0.9.0

- fix getting reduced buses list from cache was returning 'no more buses available' flag
- fix different buses lists being returned when getting reduced vs completed list (HTTP datasource)
- export OpenAPI schemas (json/yaml) with Github Actions workflow
- modify search stops endpoint for getting multiple stops by id in single request
- add alias path to Get Buses endpoint
- fix correct initialization of single Motor mongodb client
- upgrade requirements versions
- _reparado problema al obtener buses desde cache, devolviendo 'no more buses available'_
- _reparado problema al obtener buses desde fuente de datos HTTP, devolviendo distintos listados según se pidiese un listado parcial o completo_
- _exportación de esquemas OpenAPI (json/yaml) mediante workflow de Github Actions_
- _modificado endpoint de buscar paradas para poder buscar varias paradas por id en una única petición_
- _añadido alias para ruta de endpoint Get Buses_
- _reparada inicialización del cliente mongodb Motor, iniciando una única instancia_
- _actualizadas versiones de dependencias_

## 0.8.0

- add new online data source for buses (HTTP API)
- dotenv settings refactor
- _añadida nueva fuente de datos online para buses (HTTP API)_
- _refactorización de configuraciones .env_

## 0.7.1

- set Mongo stop name text index language to spanish
- _establecimiento de idioma spanish en text index de paradas guardadas en Mongo_

## 0.7.0

- add limit query param to search stops endpoint
- _añadida query param para limitar resultados en endpoint de buscar paradas por nombre_

## 0.6.1

- add unit tests
- fix clear_duplicated_buses function by simplifying logic
- _añadidos tests unitarios_
- _reparada función clear_duplicated_buses simplificando lógica_

## 0.6.0

- add endpoint to search stops by name
- get buses extra pages asynchronously (HTML datasource)
- _añadido endpoint para buscar paradas por nombre_
- _lectura de páginas extra de buses asíncronamente (fuente de datos HTML)_


## 0.5.0

- refactor request & error handling, imports & cache
- add logging
- _refactorización de request y error handling, imports y cache_
- _añadido sistema de logs_

## 0.4.0

- remove WSDL data sources
- _eliminada fuente de datos WSDL_

## 0.3.3

- remove dotenv-settings-handler as dependency and use pydantic only
- remove not required settings
- freeze requirements versions
- _quitada la dependencia dotenv-settings-handler y usar sólo pydantic_
- _borradas configuraciones no necesarias_
- _congeladas versiones de requirements_

## 0.3.2

- fix buses endpoint returning null source
- remove setup.py
- _reparado endpoint buses devolviendo source null_
- _borrar setup.py_

## 0.3.1

- store StopNotExist status on local Stop cache
- _guardar estado StopNotExist en caché local de Stops_

## 0.3.0

- define data models on project (deprecate pybusent)
- _definición de modelos de datos en proyecto (dejar de usar 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
- _reparado 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 Stops endpoint, return empty array if no buses available
- _reparado endpoint Stops, devolver array vacío si no hay autobuses disponibles_

## 0.2.0

- migrated to FastAPI, new features, using MongoDB as local storage
- _migración a FastAPI, nuevas características, usando MongoDB como almacenamiento local_

## 0.1.0

- initial release
- _release inicial_
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@

END OF TERMS AND CONDITIONS

Copyright 2019 David Lorenzo
Copyright 2021-2022 David Lorenzo @ https://github.com/David-Lor

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
67 changes: 15 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Python VigoBusAPI

[![OpenAPI docs (stable)](https://img.shields.io/badge/OpenAPI%20docs-stable-green?logo=swagger&style=plastic)](https://editor.swagger.io/?url=https://raw.githubusercontent.com/David-Lor/VigoBusAPI/master/docs/openapi.yaml)
[![OpenAPI docs (develop)](https://img.shields.io/badge/OpenAPI%20docs-develop-blue?logo=swagger&style=plastic)](https://editor.swagger.io/?url=https://raw.githubusercontent.com/David-Lor/VigoBusAPI/develop/docs/openapi.yaml)

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).
Expand Down Expand Up @@ -46,73 +49,33 @@ _La API puede devolver información de Paradas y listados en tiempo real de los

## 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

---
- `/stop/<stop_id>` : Get information about a Stop (name, location), given the Stop ID / _Obtener información de una Parada (nombre, ubicación), dado un código de parada_
- `/buses/<stop_id>` / `/stop/<stop_id>/buses` : Get the Buses that will arrive to a Stop, given the Stop ID / _Obtener los Autobuses que pasarán por una Parada, dado su código de parada_
- `/stops?stop_name=<name>&limit=<limit>` : Search stops by name (optional limit) / _Buscar paradas por nombre (límite opcional)_
- `/stops?stop_id=<id2>&stop_id=<id2>` : Search multiple stops by id in the same request
- `/docs` : Swagger UI (documentation) auto-generated by FastAPI / _Documentación Swagger UI auto-generada por FastAPI_

- _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_
## [Changelog](CHANGELOG.md)

## TODO

- Improve Swagger/OpenAPI documentation
- Add static route information endpoints
- Add Near Stops endpoint
- Add more tests
- Add endpoint for static maps and StreetView acquisition
- Add endpoints for static buses info
- Add integration 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 endpoint para obtención de mapas estáticos y StreetView_
- _Añadir endpoints para consulta de información estática de buses_
- _Añadir tests de integración_
- _Añadir instrucciones detalladas de instalación y configuración_
- _Usar la nueva fuente de datos para obtener datos de paradas_

## Disclaimer

Expand Down
Loading

0 comments on commit f77f7d6

Please sign in to comment.