Skip to main content

API crowd microprediction and microprediction contests at

Project description


Collective microprediction client leveraging

pip install microprediction 

This library is still under construction. There is a teaser at


It is possible to retrieve most quantities at with direct web calls.

import requests
lagged_values = mr.get('lagged_values::cop.json')
lagged_values = requests.get('').json()

However the reader client adds a little convenience.

from microprediction import MicroReader
mr = MicroReader()

summary       = mr.get_summary('cop.json')
current_value = mr.get('cop.json')
lagged_values = mr.get_lagged_values('cop.json') 
lagged_times  = mr.get_lagged_times('cop.json')

Approximate crowd cumulative distribution function:

cdf = mr.get_cdf('cop.json',delay=70)

Quarantined value

cdf = mr.get_delayed('cop.json',delay=70)

Write client

For both requesting and supplying distributional predictions.

Obtaining a write_key (

As explained at you need to mine a MUID to obtain write privileges, such as submitting predictions. You can cut and paste this bash command into terminal:

/bin/bash -c "$(curl -fsSL"

or using the MUID library...

$pip install muid
>>> import muid
>>> muid.mine(skip_intro=True)

Once you have a key:

from microprediction import MicroWriter
mw = MicroWriter(write_key='53e6fbba-2dcd-486c-a4ab-14759db58dde')  # Sub in your own key 

Submitting predictions

scenarios = [ i*0.001 for i in range(mw.num_predictions) ] 

Submitting data to be predicted

You can use the writer to create a stream of live data that clever algorithms and humans can predict.


You can write a new stream if:

len(muid.animal(mw.write_key))  >  official minimum length     # You have a hard to find MUID


mw.balance()  >   official minimum balance     # You've been good at predicting things !

See for the current values of min_len and min_balance. See for explanation of muid.animal().

Updating the current value

Set current value.

prctl = mw.put(name='mystream.json',value=3.14157) 

By default this returns a percentile so you know how surprising the data point is.

Distribution of future values

You can retrieve quarantined crowd cumulative distribution function:

 cdf = mr.get_cdf('cop.json',delay=mr.delays[0],values=[0,0.5])

where the delay parameter, in seconds, acts as a prediction horizon.


Limited logging information may be retrieved:



error_log = requests.get('').json()

Project details

Release history Release notifications | RSS feed

Download files

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

Files for microprediction, version 0.0.12
Filename, size File type Python version Upload date Hashes
Filename, size microprediction-0.0.12-py3-none-any.whl (6.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size microprediction-0.0.12.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page