64 lines (43 sloc) 1.9 KB

Rosie, the robot

A Python application reading receipts from the Quota for Exercising Parliamentary Activity (aka CEAP) from the Brazilian Chamber of Deputies and outputs, for each of the receipts, a probability of corruption and a list of reasons why it was considered this way.


With Docker

$ docker run --rm -v /tmp/serenata-data:/tmp/serenata-data datasciencebr/rosie python run <module_name>

Then check your /tmp/serenata-data/ directory in you host machine for suspicions.xz.

For testing

$ docker run --rm -v /tmp/serenata-data:/tmp/serenata-data datasciencebr/rosie python test

Without Docker


There are a few options to setup your environment and download dependencies. The simplest way is installing Anaconda then run:

$ conda update conda
$ conda create --name serenata_rosie python=3
$ conda activate serenata_rosie
$ pip install -r requirements.txt


To run Rosie, you need to select a module to be called. For example, if you want to run chamber_of_deputies module, you should run this command:

$ python run chamber_of_deputies

A /tmp/serenata-data/suspicions.xz file will be created. It's a compacted CSV with all the irregularities Rosie is able to find.

Also a target directory (where files are saved) can de passed — for example:

$ python run chamber_of_deputies /my/serenata/directory/

Test suite

You can either run all tests with:

$ python test

Or test each submodule a time by passing a name:

$ python test core
$ python test chamber_of_deputies
$ python test federal_senate