Skip to main content
https://travis-ci.org/tensorjack/pyconsensus.svg?branch=master https://coveralls.io/repos/tensorjack/pyconsensus/badge.png

pyconsensus is a Python implementation of the Truthcoin consensus mechanism, originally invented by Paul Sztorc: https://github.com/psztorc/Truthcoin.

Installation

The easiest way to install pyconsensus is using pip:

$ pip install pyconsensus

To upgrade your pyconsensus installation, use:

$ pip install --upgrade --no-deps pyconsensus

Usage

To use pyconsensus, import the Oracle class:

from pyconsensus import Oracle

# Example vote matrix:
#   - each row represents a voter
#   - each column represents a decision in a prediction market
my_votes = [[1, 1, 0, 0],
            [1, 0, 0, 0],
            [1, 1, 0, 0],
            [1, 1, 1, 0],
            [0, 0, 1, 1],
            [0, 0, 1, 1]]
my_decision_bounds = [
    {"scaled": True, "min": 0.1, "max": 0.5},
    {"scaled": True, "min": 0.2, "max": 0.7},
    {"scaled": False, "min": 0, "max": 1},
    {"scaled": False, "min": 0, "max": 1},
]

oracle = Oracle(votes=my_votes, decision_bounds=my_decision_bounds)
oracle.consensus()

Tests

Unit tests are in the test/ directory.

Release files for pyconsensus 0.1.5

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

Source distribution (sdist)

Source distribution for pyconsensus 0.1.5
File Size Uploaded
pyconsensus-0.1.5.tar.gz 21.5 kB Details

Release files / pyconsensus-0.1.5.tar.gz

Download URL pyconsensus-0.1.5.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7bbd704c87d76279735e34b130959c05952d01ced9fbdf6994284f16415cdfc6
BLAKE2b-256 checksum
How to use checksums
f946bfc95ae0e1f270aefd63e44a16aafa5ebce1346f9e15c89b16922a74b975
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.5.8

1 release file

0.5.7

1 release file

0.5.6

1 release file

0.5.4

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5

1 release file

0.4.1

1 release file

0.4

1 release file

0.3

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2

1 release file

0.1.6

1 release file

This release

0.1.5 This release

1 release file

0.1.4

1 release file

0.1.2

1 release file

0.1.1

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