Demo API using fastapi with one route that takes a datetime string and returns open restaurants, if any
Create a .env file in the root directory of your project based off of the .env.sample
file.
Install Docker and run the following command to startup the database/api in Docker:
docker compose up --build --pull postgresql --remove-orphans -V --wait
Once the database is up, we need to perform the database migration. To do this, run the following command:
poetry run alembic upgrade head
To lint the project, run the following commands:
poetry run flake8 app tests
poetry run pylint app tests
To run the tests, be sure you have ran the Docker Compose Command and the Alembic Database Migrations, then run the following command:
poetry run pytest --cov --cov-report=html -n auto
This will run the tests using xdist on multiple threads and generate a coverage report in the htmlcov directory.
I imported the provided CSV into Google Sheets to easily calculate the number of rows the csv import should make. You can view that via this link: https://docs.google.com/spreadsheets/d/1t4kAuOgT4Oqoldq02rXDrrO2Mwgy80UkcfTBPhnlpK4/edit?usp=sharing