Skip to main content

Nozbe interface wrapper.

Project description

mekk.nozbe wraps (noticeable parts of) Nozbe API as Python functions.

It uses both old, officially published API ( and new (not yet officially docunented) “Sync API”. Neither of those APIs is fully covered (the module supports the functions which were working at early 2009 and which I needed), but still I succesfully use the library to extract projects, contexts and tasks from Nozbe and to create new (or update existing) items.

The code is currently using Twisted network interface (that means returning deferreds etc). Well, I like Twisted. I consider providing urllib-based synchronous API as an alternative, just need some motivation.

Development is tracked on


Some simple example:

from mekk.nozbe import NozbeApi
from twisted.internet import reactor, defer

# API KEY servers as an authentication token.
# Check for your own at Nozbe extras page (
# Note that publishing it is equivalent to publishing the password.
API_KEY = "grab your own from Nozbe"

# Data needed to run on Nozbe development server (contact Nozbe owner
# to get the account there). Those are HTTP authentiation credentials.
# Not needed for run against production site
DEVEL_MODE = { 'user': 'devel_username',
               'password' : 'devel_password' }

def make_some_calls():
    nozbe_client = NozbeApi(API_KEY)  # run on production
    #nozbe_client = NozbeApi(API_KEY, DEVEL_MODE)

    print "* Some projects"
    projects = yield nozbe_client.get_projects()
    for project in projects[:3]:
        print project

    print "* Some contexts"
    contexts = yield nozbe_client.get_contexts()
    for context in contexts[:3]:
        print context

    print "* Some tasks"
    tasks = yield nozbe_client.get_tasks()
    for task in tasks[:3]:
        print task

    print "Adding example task"
        u"Example task made using script",
        project_hash = projects[0]['hash'],
        context_hash = contexts[0]['hash'],
        next = 1)

    yield nozbe_client.save_changes()

def main():
        yield make_some_calls()

reactor.callLater(0, main)

Project details

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page