MarcosX / rosie

🤖 Python application responsible for Serenata de Amor's intelligence

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rosie, the robot

Build Status Code Climate Coverage Status donate

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.

Running

With Docker

$ docker build -t rosie .
$ docker run --rm -v /tmp/serenata-data:/tmp/serenata-data rosie

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

Without Docker

Setup

$ conda update conda
$ conda create --name serenata_rosie python=3
$ source activate serenata_rosie
$ ./setup

Running

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 rosie.py run chamber_of_deputies

The toolbox expects to find Amazon credentials in a config.ini file. If You get an error of missing config.ini you can just copy the config.ini.example to a config.ini and everything will run smoothly (don't bother about AccessKey and SecretKey unless you're planning to upload files to S3).

A /tmp/serenata-data/irregularities.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 rosie.py run chamber_of_deputies /my/serenata/directory/

Test suite

You can either run all tests with:

$ python rosie.py test

Or test each submodule a time by passing a name:

$ python rosie.py test core
$ python rosie.py test chamber_of_deputies
$ python rosie.py test federal_senate

About

🤖 Python application responsible for Serenata de Amor's intelligence

License:MIT License


Languages

Language:Python 100.0%