This document explains how you can install the API for accessing the database. To deploy the website, see Install development environment.

We assume you know a little of Python and know how to install Python packages in your computer using pip.

Getting the source

The source can be either downloaded or cloned from the GitHub repository using:

git clone

Like most Python code, the source doesn’t need to be installed; you just have to put it somewhere in your computer.

You need Python 3.


For using the code, you need to install three python packages:


We use Django ORM to abstract ourselves of the idea of database and use Python classes to work with the data:

pip install Django


Our remote database is in postgres. To Python communicate with it, we need a binding:

pip install psycopg2


The categories in the database are organized in a tree structure. We use django-treebeard to efficiently storage them in our database.

Install using:

pip install django-treebeard

Running the example

Once you have the dependencies installed, enter in its directory and run:

python -m

If everything went well, it outputs two numbers:

  1. the total number of contracts in the database, that you can corroborate with the official number.
  2. the sum of the values of all contracts.

If some problem occur, please add an [issue]( so we can help you and improve these instructions.

From here, you can see section Asking questions to the database for a tutorial, and section API Reference for the complete documentation.