Dependencies
Overview
The API and confidentialisation-on-the-fly routine is written in Python 3.6+, using Flask, a micro web framework. It uses SQLAlchemy to interface with an SQL database (which works with most SQL dialects, including Oracle, MS-SQL, and Postgres). It conforms to the OpenAPI 2.0-compliant API (formerly known as a swagger spec). The API routines, SQL interface routines and the perturbation routines are in separate python modules.
The code is divided into three repositories:
protari
: The key routines used by Protari.protari-api
: A layer to present Protari as a RESTful API.protari-setup
: Helper code, eg. to translate metadata from one format to another, to populate a database from a csv file. It contains examples and a script to build a sample database and configuration files.
Specific Package Requirements
The API depends on a number of open source packages, with the key ones outlined in the previous section. The definitive list is given in the Pipfile.lock files in each repository.
Oracle
To use the API with an Oracle database, you need to install some dependencies first, as described on the Oracle website.
Then you'll need to install the cx_Oracle
package, eg. using pipenv:
pipenv install cx_Oracle
If you get ERROR:ORA-21561: OID generation failed
on running the API, you will need to modify /etc/hosts
according to this post.