Skip to main content

Implementation of all the tools necessary to explore and analyse participatory budgeting elections

Project description

Pabutools: PB as easy as ABC

PyPI Status Build badge codecov

Overview

The pabutools are a complete set of tools to work with participatory budgeting instances.

Participatory budgeting (PB) is a democratic tool used to allocate a given amount of money to a collection of projects based on a group of individuals' preferences over the projects. It has been invented in Brazil in the late 80's and is now a widely implemented. See the Wikipedia page for more details.

In this library, we provide tools that

  • handle PB instances of different kinds,
  • compute voting rules to determine the outcome of the elections,
  • analyse outcomes, and
  • provide full support for the instances taken from the pabulib library of PB data.

Installation

The package can be installed from PyPI using:

pip3 install pabutools

Documentation

The complete documentation is available here. It includes

Development

We are more than happy to receive help with the development of the package. If you want to contribute, here are some elements to take into account.

First, install the development dependencies by running the following command:

pip install -e ".[dev]"

You can run the unit tests with the following:

python -m unittest

The doc is generated using sphinx. We use the numpy style guide. The napoleon extension for Sphinx is used and the HTML style is defined by the Book Sphinx Theme.

To generate the doc, first move inside the docs-source folder and run the following:

make clean 
make html

This will generate the documentation locally (in the folder docs-source/build). If you want the documentation to also be updated when pushing, run:

make githubclean
make github

After having pushed, the documentation will automatically be updated.

Note that a large part of the documentation is done by hand (to ensure proper display and correct ordering). This means that if you create new class of functions that should appear in the documentation, you may have to add they yourself using to autodoc directives (take inspiration from the files in docs-source/source).

If you want to help, check the todos.txt file, several todos are described there.

GitHub Workflow

Publishing on PyPI

The pipeline between GitHub and PyPI is automatised. To push a new version do the following:

  • Update the pyproject.toml with the new version number.
  • Update the pabutools/__init__.py with the new version number.
  • On GitHub, create a new release tagged with the new version number (only admins can do that), on this page.
  • You're done, the new version of the package is automatically pushed to PyPI after the creation of a GitHub release.

Building the Docs

If the docs-source has been updated but the docs/ folder has not, you can build the docs via a GitHub action here: https://github.com/COMSOC-Community/pabutools/actions/workflows/docs.yml. Simply click "Run workflow" and the docs will be built and the built files will be pushed back to the server.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pabutools-1.1.10.tar.gz (100.8 kB view details)

Uploaded Source

Built Distribution

pabutools-1.1.10-py3-none-any.whl (134.2 kB view details)

Uploaded Python 3

File details

Details for the file pabutools-1.1.10.tar.gz.

File metadata

  • Download URL: pabutools-1.1.10.tar.gz
  • Upload date:
  • Size: 100.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pabutools-1.1.10.tar.gz
Algorithm Hash digest
SHA256 0fda4b4e3f14b61ad60524e6fef9fc8b6190009a27205a4704c6fa6857267d2b
MD5 0be6e934b3740d2c2877a41a7fd9658e
BLAKE2b-256 35199305b8c40a3ec36261db614fcb61fb5842bd720298debcd1bf125b0fa49d

See more details on using hashes here.

File details

Details for the file pabutools-1.1.10-py3-none-any.whl.

File metadata

  • Download URL: pabutools-1.1.10-py3-none-any.whl
  • Upload date:
  • Size: 134.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pabutools-1.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 b01270a0f6477857134f0df6e215f655fbfc23463753108191456d4483e9dfd3
MD5 0d7b6133a8384ca9dd52982b89e487a7
BLAKE2b-256 e85ea50f06f76506a5e49bffc51ed807cf63e427330c0e78394253857db7dc10

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page