Developer’s guide
This API-REST was developped with python 3.10.6 with the version 2.1.0 of pygoslin.
Dependencies required
This API rests on several dependencies :
To build the application :
falcon 3.1.1 : Framework web for building REST APIs and micrservice
loguru 0.6.0 : Library for implementong logging
pandas 2.0.0 : Library for manipulating data structure
requests 2.28.2 : Library for sending HTTP requests
To build the documentation :
swagger-ui-py 22.7.13 : Library for configuring the Swagger documentation
- sphinx 6.2.1Tool to build this documentation
sphinx-rtd-theme 1.2.0 : Sphinx extension to use the “Read the Docs” sphinx-rtd-theme
enum_tools[sphinx] 0.9.0 : Sphinx extension to support autogeneration of the documentation for an Enumeration
Note
All theses dependencies are listed in the requierements.txt
file and can be install at once with the command :
$ pip install -r requierements.txt
Unit and functional testing
Unit and functional tests are in the tests
directory. To run all tests, use the following command :
$ make tests
If you already set up a virtual environment with all the required dependencies, you can use this command instead from the API root directory :
$ python3 -m unittest tests/test_*
Code organisation
.
├── conf
│ ├── goslin_about.json
│ ├── goslin_doc.yaml
│ └── lipid-list.csv
├── doc
│ ├── conf.py
│ ├── developers_guide.rst
│ ├── functions.rst
│ ├── home.rst
│ ├── index.rst
│ ├── output.rst
│ ├── request_with_python.rst
│ └── vars.rst
├── Dockerfile
├── main
│ ├── goslin_fct.py
│ ├── goslin_rest.py
│ ├── messages.py
│ └── vars.py
├── Makefile
├── README.md
├── requirements.txt
└── tests
├── test_argument.py
├── test_fct_goslin.py
└── test_unit_goslin.py
conf
Directory containing the configuration files
goslin_about.json
: Template JSON with the metadata on the microservice and the tool.goslin_doc.yaml
: YAML file configuring the Swagger documentation following the OpenAPI 3.0 standard.lipid-list.csv
: CSV file containing the lipid class supported by the tool.
doc
Directory containing the documentation
main
Code of this Goslin REST-API
goslin_fct
: Module containing core functions used by the REST-API.goslin_rest
: Module defining and configuring the REST-API.messages
: Module defining messages that can me returned by the REST-API.vars
: Module defining variables used by the REST-API
tests
Unit and functional tests
test_argument
: Tests for the arguments that can be used when running the REST-API.test_fct_goslin
: Fonctional tests of the REST-API.test_unit_goslin
: Unit tests of the REST-API.