/chrimatocracy

Primary LanguagePythonMIT LicenseMIT

Chrimatocracy

Data Science applied to the government sector

Build

You'll need to install Poetry and set a list of environment variables:

Poetry Installation

We are using the 1.1.10 version, type:

curl -sSL https://install.python-poetry.org | python3 - --version 1.1.10

Add export PATH="/Users/<user.name>/.local/bin:$PATH" to your shell configuration file (eg. ~/.zshrc) and restart your terminal and check if Poetry was installed correctly.

poetry --version

Straightforward instructions for setting up and running Chirmatocracy

These are provisory instructions for working with provisory branches.

  1. Clone the project:

    git clone https://github.com/felipeeeantunes/chrimatocracy.git
  2. Switch to the specific branch you are going to work on (feature/structuring-modules, for instance):

    git switch feature/structuring-modules
  3. Go inside the directory and build the environment:

    cd chrimatocracy
    make build

    Ps. You can use the Poetry commands to create local environments and builds instead.

  4. Code patterns

    # run these commands below before adding files to commit
    make isort
    make black
    # then, git add <files>...

Using the library for Reseach

Under the research folder you find two applications of the library:

  1. donations contains the code of the paper Statistical analysis of Brazilian electoral campaigns via Benford’s law published at Physica A: Statistical Mechanics and its Applications. The preprint can be found on Arxiv as Evidence of Fraud in Brazil's Electoral Campaigns Via the Benford's Law

  2. network contains the code behind an ongoing research project called Detecting Anomaly donations by Combining Benford's Law and Social Network Analysis.

Also, you can find, under notebooks Jupyter notebooks (outdated) with descriptive analyses of the data.

Data

You can find the data in raw format and already prepared (using data_preparation scripts) here. The raw data is public and was obtained from the TSE website.

Data from CEIS and CNEP (containing companies with restrictions) was obtained from Portal da Transparência and the links are: