Skip to content
zkpy is a wrapper around Zookeeper's Python library
Python
Pull request Compare This branch is 9 commits ahead, 6 commits behind luk:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
examples
tests
zkpy
.gitignore
README.md
setup.py

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.