Installing it yourself
The best way to run the Protari API is to import it as a package into your own python module (the "Protari instance" in the above diagram).
protari-sample repository is a ready-to-go example.
It contains some sample datasets and some sample data.
protari-sample and follow the instructions provided there.
The gist of those instructions is provided below.
If you want to develop the Protari libraries themselves, see the Developer's guide to setting up Protari.
The code relies on
git+ssh to refer to other dependencies, so you will need to register
your ssh key.
Choose the latest tagged version of protari-sample
git tag and choose the latest tag shown (eg.
1.0.0). Then type:
git checkout 1.0.0 # Replace the version with the latest tag.
Install Python, pip and pipenv
The API has been developed for Python 3.6, although later versions may work too.
Install the Required Packages
protari-sample directory, install the required packages into a virtual environment
(including the ability to connect to a Postgres database), and enter that environment, via:
pipenv install --dev pipenv shell
pipenv install --dev installs the
protari-setup library, which is not required to run the API, but is
required to build the database. (In production, where you are connecting to a pre-existing database,
you would use
pipenv install without the
Set up a Sample Database
Ensure your database server is running, eg. installing a postgres server.
Then, still in the
protari-sample directory, type:
Run the API's dev server
You can now run the API by typing (again, still in the
You can test it out in your browser by navigating to
v1 may change. See the file
protari-api/swagger.yaml file for the current version.)
That page provides an interface for exploring the API.
Alternatively you can check out the full API specification at
Note – do not use this development web server in production, as it does not scale well and serves only one request at a time. Some of the options available for properly running Flask in production are documented in the Flask documentation here. The server can be anything that supports WSGI (eg. Apache with mod_wsgi or nginx). The only required static files are those that provide the swagger UI for the API, if enabled.