pyconsensus
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.
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyconsensus-0.1.5.tar.gz | 21.5 kB | Without provenance | Details for pyconsensus-0.1.5.tar.gz |
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 |
Security for pyconsensus 0.1.5
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.