-
Create virtual environment and activate:
python -m venv .venv \ && source .venv/bin/activate \ && pip install -U pip wheel
-
Install package
pip install -e api -r api/requirements.txt
Or with optional dev dependencies:
pip install -e "api[dev]" -r api/requirements.txt -r api/requirements_dev.txt
- Register for and verify an account.
- Log into your account.
- Select the API section on account settings.
- Click on the link to generate a new API key and follow the instructions.
Copy the .env.example
into a new .env
file
Edit the file and enter your API token.
uvicorn app.api:app --reload
Visit the OpenAPI docs at https://localhost:8000/docs
Dependencies are specified in pyproject.toml
and managed with pip-tools.
-
Install
pip-tools
(globally with pipx or in local virtual environment withpip
) -
Generate lock files:
cd api \ && pip-compile --output-file=requirements.txt pyproject.toml --quiet \ && pip-compile --extra=dev --output-file=requirements_dev.txt pyproject.toml --quiet \ && cd ..
To upgrade a dependency, pass the --upgrade-package
flag along with the name of the package, or to upgrade all packages, pass the --upgrade
flag to the command.
More information at: https://github.com/jazzband/pip-tools/
Since our python app is in api/
directory, isort
has trouble finding it.
Pass the src
config into the isort arguments.
{
"isort.args": ["--profile", "black", "--src", "api"]
}
pytest api