This repo is started by following instruction on this link. This project is intended to wrap the PostgreSQL datebase around using Python framework FastAPI to record my personal running training time.
API documentation created using Postman, collection is available here.
The table contains the following field:
- id
- distance
- intensity
- total time
- date
Should you want to add field in your table, you could modify the end point 'createTable' at main.py
Install development dependencies via:
poetry install
Poetry is a package manager for Python that utilises the latest pyproject.tml
project files.
pyproject.tml
will eventually replace setup.py
as the de facto standard
for managing and distribution Python projects.
Install poetry:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
Check poetry is installed by displaying the help. The help is displayed by running:
poetry
After installing poetry, run:
poetry install --no-dev
Start the server with the following:
poetry run uvicorn src.server.main:app --reload
Check linting:
poetry run flake8 src --statistics
Automatically fix linting issues:
poetry run autopep8 --in-place -r src