Skip to main content

k3zkutil

Action-CI Documentation Status Package

Some helper function to make life easier with zookeeper.

k3zkutil is a component of pykit3 project: a python3 toolkit set.

Some helper function to make life easier with zookeeper.

Install

pip install k3zkutil

Synopsis

import k3zkutil

"""
config.zk_acl      # (('xp', '123', 'cdrwa'), ('foo', 'bar', 'rw'))
config.zk_auth     # ('digest', 'xp', '123')
config.zk_hosts    # '127.0.0.1:2181'
config.zk_node_id  # 'web-01'
config.zk_lock_dir # 'lock/'
"""
with k3zkutil.ZKLock(
    "foo_lock",
    zkconf={
        "hosts": "127.0.0.1:2181",
        "acl": (("xp", "123", "cdrwa"),),
        "auth": ("digest", "xp", "123"),
        "node_id": "web-3",
        "lock_dir": "my_locks/",
    },
):
    print("do something")
lock = k3zkutil.ZKLock("foo")
try:
    for holder, ver in lock.acquire_loop(timeout=3):
        print("lock is currently held by:", holder, ver)

    print("lock is acquired")
except k3zkutil.LockTimeout:
    print('timeout to acquire "foo"')

Author

Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Copyright and License

The MIT License (MIT)

Copyright (c) 2015 Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Metadata

Release files for k3zkutil 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for k3zkutil 0.1.11
File Size Uploaded Provenance Actions
k3zkutil-0.1.11.tar.gz 25.7 kB Without provenance Details for k3zkutil-0.1.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for k3zkutil 0.1.11
File Interpreter ABI Platform Actions
k3zkutil-0.1.11-py3-none-any.whl Python 3 none any Details for k3zkutil-0.1.11-py3-none-any.whl

Total release size: 43.7 kB

Release files / k3zkutil-0.1.11.tar.gz

Download URL k3zkutil-0.1.11.tar.gz
Size 25.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7816814cc8f7a21aca613382227deb0f4a3b43335d86e600b35ee2a7f43edf3c
BLAKE2b-256 checksum
How to use checksums
4089a4927e241dc7a861c005c6845e05a64822510782a8a578b50943e32c1a03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / k3zkutil-0.1.11-py3-none-any.whl

Download URL k3zkutil-0.1.11-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
256b6fc694a2662ef84b3764e69cd5353d12d67b24ac0399382e64e336f7336e
BLAKE2b-256 checksum
How to use checksums
a56594b7edd6f1330a0649b32dd07799994aedee0104dfa50fbbb62412023df4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for k3zkutil 0.1.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page