Skip to content

akpascalp/rest-api

Repository files navigation

Test API

Test API

Installation

  1. Install python >=3.10

Install the latest version of python >=3.10 available.
You can find all Python releases on https://www.python.org/downloads/release

  1. Setup a new virtual environment

Run command:

{PATH TO PYTHON 3.10} -m venv {PATH TO VIRTUAL ENVIRONMENT}

// Example in project folder
python3 -m venv venv
  1. Active virtual environment

Run command:

// Windows - CMD
{PATH TO VIRTUAL ENVIRONMENT}\Scripts\Activate.bat
// Windows - PowerShell
{PATH TO VIRTUAL ENVIRONMENT}\Scripts\Activate.ps1
  1. Update Pip Run command:
python -m pip install --upgrade pip
  1. Install the project requirements Run command:
pip install -r requirements.txt
  1. Install project in editable mode Run command:
pip install -e .

Usage

Running the project starts a REST service that runs until stopped.

By default, the project runs in development mode, meaning that debug messages will be displayed. For development, we can start it using the Flask CLI directly.

.env.bat
flask run -p 5000

Documentation

The documentation of the project is located in the docs folder. It is automatically generated using Sphinx.

To build the documentation, run:

sphinx-apidoc -f -o .\docs\source\ testapi
sphinx-build -b html .docs\\source\ .\docs\build\

Then, open the index.html file in the build directory and browse the documentation to your liking.

Building the project

Installing the requirements

Run command:

pip install -r requirements_dev.txt

Testing

To run the test suite, run tox. tox will also automatically format your code and sort all your imports.

You can also run the tests using pytest directly.

About

REST API built with Flask

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published