Skip to content
Neil Webber edited this page Oct 11, 2015 · 9 revisions

NumerousApp Python API

This class implements the NumerousApp API in python. You can read and write metrics ("numbers" you have set up in Numerous), create comments on metrics, access metric event streams, delete metrics, change your subscriptions, etc.

Also there is a Unix/Linux shell command "nr" that gives you command-line access to most functions of the NumerousApp APIs.

The code works in either major version (2.x or 3.x) of python.

Contents

Getting started

Get your API key from the NumerousApp on your mobile device. It's in Settings/Developer Info.

Put that key into a file such as ~/.mycred and set the NUMEROUSAPIKEY environment variable accordingly:

% echo nmrs_3xblahblahblah > ~/.mycred
% NUMEROUSAPIKEY=~/.mycred export NUMEROUSAPIKEY

See APIKey Management for nine thousand other ways you can handle the API key.

Get your metric ID -- you will find this in Developer Info in the settings panel on any individual metric.

IMPORTANT The metric ID should look like a large integer. Something like 9208972516053673667 made up entirely of digits (but pass it in as a string). You can also use some URL forms and event some dictionary forms; see the metric method documentation for details.

Now write code like this:

import numerous
nr = numerous.Numerous()
m = nr.metric('234203820395828234')
print(m.read())
m.write(77)

Or create a metric like this:

m = nr.createMetric('MyMetricName')
m.write(17)

This creates a public metric with label 'MyMetricName' on the server and sets its value to 17. See createMetric for more details.

You can’t perform that action at this time.