Skip to main content

pyconsensus

https://badge.fury.io/py/pyconsensus.svg

pyconsensus is a standalone Python implementation of Augur’s consensus mechanism. For details, please see the Augur whitepaper.

Installation

The easiest way to install pyconsensus is to use pip:

$ pip install pyconsensus

Usage

To use pyconsensus, import the Oracle class:

from pyconsensus import Oracle

# Example report matrix:
#   - each row represents a reporter
#   - each column represents an event in a prediction market
my_reports = [[0.2, 0.7,  1,  1],
              [0.3, 0.5,  1,  1],
              [0.1, 0.7,  1,  1],
              [0.5, 0.7,  2,  1],
              [0.1, 0.2,  2,  2],
              [0.1, 0.2,  2,  2]]
reputation = [1, 2, 10, 9, 4, 2]
my_event_bounds = [
    {"scaled": True, "min": 0.1, "max": 0.5},
    {"scaled": True, "min": 0.2, "max": 0.7},
    {"scaled": False, "min":  1, "max": 2},
    {"scaled": False, "min":  1, "max": 2},
]

oracle = Oracle(reports=my_reports,
                reputation=reputation,
                event_bounds=my_event_bounds)
oracle.consensus()

Tests

Unit tests are in the test/ directory.

pyconsensus is used in conjunction with the Augur Simulator to carry out randomized numerical (Monte Carlo) consensus tests. See the Simulator repository for details.

Metadata

Release files for pyconsensus 0.5.8

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.5.8
File Size Uploaded Provenance Actions
pyconsensus-0.5.8.tar.gz 23.5 kB Without provenance Details for pyconsensus-0.5.8.tar.gz

Release files / pyconsensus-0.5.8.tar.gz

Download URL pyconsensus-0.5.8.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f83f60433b9e5f86a6d4e60b42921139c23d65d124e0aa1408b7caccf7d6b339
BLAKE2b-256 checksum
How to use checksums
ee73f5397cdbf723fb5cdbcd0200bfad6c7baeee5da678c5887b3e5b0a8a3b08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pyconsensus 0.5.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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