Skip to the content.

More detail on publishing streams using Python. See publish for alternatives.

Publishing using Python

pip install microprediction

BYO scheduling

If you are happy scheduling things yourself by whatever means, just use MicroWriter.set() to publish.

from microprediction import MicroWriter
mw = MicroWriter(write_key='YOUR WRITE KEY HERE')


Alternatively, use MicroPoll as illustrated by

from microprediction.polling import MicroPoll
from import verrazano_speed
poller = MicroPoll(write_key='YOUR KEY HERE',

Here interval is in minutes. The argument func should be a function returning a float, and you can supply func_args if needed.


It often pays to publish changes to live quantities, rather than absolute values, as this obviates the need for algorithms to precisely anticipate publishing times. The class MicroChangePoll can help and is illustrated by Note the suspension and resumption logic.


See for an illustration of using slightly more advanced functionality provided in, including the use of a change_func to create streams that are functionals of changes in values.

After you publish

Video tutorials

Reminder: write keys

You can use a colab notebook to burn a new WRITE_KEY.


Documentation map

Edit this page.