jhanley634 / dojo-blackboard

An HTMX webserver for the Dojo's Tuesday night python meetups.
MIT License
3 stars 1 forks source link

5 transit #6

Closed jhanley634 closed 2 months ago

jhanley634 commented 2 months ago

Summary by Sourcery

Add a new '/transit/vehicles' endpoint to query vehicle locations from the transit API, implement caching for requests, and refactor the root endpoint to dynamically generate a table of contents. Enhance the project structure by reorganizing modules and add new tests to cover the introduced functionalities.

New Features:

Enhancements:

Build:

Tests:

sourcery-ai[bot] commented 2 months ago

Reviewer's Guide by Sourcery

This pull request implements several new features and refactors existing code to improve the structure and functionality of the bboard application. The changes include adding transit vehicle querying capabilities, implementing caching for API requests, reorganizing the project structure, and improving the web interface.

File-Level Changes

Change Details Files
Implemented transit vehicle querying functionality
  • Added a new endpoint '/transit/vehicles' to query transit API for vehicle locations
  • Created a new module for handling transit-related operations
  • Implemented functions to format and process vehicle data
src/bboard/main.py
src/bboard/transit/vehicles.py
tests/vehicles_test.py
Refactored and improved the web interface
  • Updated the root endpoint to use a dynamic table of contents
  • Created a utility module for web-related functions
  • Moved the '/hello' endpoint to '/demo/hello'
src/bboard/main.py
src/bboard/util/web.py
Implemented request caching mechanism
  • Added a utility to patch the requests module with caching functionality
  • Created a test to verify the caching behavior
src/bboard/util/requests.py
tests/requests_test.py
Added credential management utilities
  • Implemented functions to read and manage API keys
  • Created a utility to generate environment variable scripts for API keys
src/bboard/util/credentials.py
src/bboard/util/credential_env_vars.py
tests/credentials_test.py
Reorganized project structure
  • Moved greeting-related code to a demo subdirectory
  • Created utility modules for filesystem operations
  • Updated import statements across the project
src/bboard/main.py
tests/greeting_test.py
src/bboard/util/fs.py
Updated Makefile
  • Added a 'run' target to start the FastAPI development server
  • Updated the .PHONY list to include the new 'run' target
Makefile
Added placeholder for future vehicle mapping functionality
  • Created a new file with imports for Pub0 and Sub0 from pynng
src/bboard/sources/vehicle_map.py

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.