Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
zkpy is a wrapper around Zookeeper's Python library
branch: master

This branch is 6 commits behind luk:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
zkpy
.gitignore
README.md

README.md

zkpy

zkpy is a wrapper around Zookeeper's Python library, that should provide

Short example:

from __future__ import with_statement
from zkpy.acl import Acls
from zkpy.connection import zkopen, KeeperState, EventType, NodeCreationMode

# define a watcher function
def global_watcher(type, state, path):
    print 'GLOBAL: event=%s, state=%s, path=%s' % (EventType[type], KeeperState[state], path)

with zkopen('localhost:2181', 5) as conn:
    # add a connection watcher for fun
    conn.add_global_watcher(global_watcher)

    # create a node
    conn.create('/bar','', [Acls.Unsafe], NodeCreationMode.Ephemeral)
    print conn.get_children('/')

Todo:

  • Better zookeeper wrapping (Exceptions, return codes)
  • More recipes
  • Tests
  • Documentation
Something went wrong with that request. Please try again.