Skip to main content

Pabutools: PB as easy as ABC

PyPI Status Build Status 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 be automatically deployed to the GitHub page.

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).

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.

Release files for pabutools 1.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pabutools 1.2.3
File Size Uploaded
pabutools-1.2.3.tar.gz 108.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pabutools 1.2.3
File Interpreter ABI Platform
pabutools-1.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 257.7 kB

Release files / pabutools-1.2.3.tar.gz

Download URL pabutools-1.2.3.tar.gz
Size 108.8 kB
Tags Source
SHA-256 checksum
How to use checksums
68ef028693a7a48381b8a1653614f0927368da0815bcd76c625e0511df618802
BLAKE2b-256 checksum
How to use checksums
9d5f582d36c45dd6e65a7f35dd6d81c479dd934078e629158ee389b90aa50cad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / pabutools-1.2.3-py3-none-any.whl

Download URL pabutools-1.2.3-py3-none-any.whl
Size 149.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b4ea82d1b42d8252355af5231807bc8b66aa1db6a5773a8e85c7ca5f102ec77
BLAKE2b-256 checksum
How to use checksums
28a475663558eabb0adef3e569f4cf7b16cefc065392664750c4ea39f62862da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.2.3 This release

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.17

2 release files

1.1.16

2 release files

1.1.15

2 release files

1.1.14

2 release files

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.0

2 release files

0.12

2 release files

0.11

2 release files

0.10

2 release files

0.9

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page