Flask-Zookeeper
The Flask-Zookeeper extension provides support to Zookeeper clusters.
Quickstart
First, install cdumay-rest-client using pip:
pip install flask-zookeeper
Flask-Zookeeper depends, and will install for you, recent versions of Flask and Kazzo. Flask-Zookeeper is compatible with and tested on Python 2.7, 3.4 and 3.5.
Next, add a FlaskZookeeperClient instance to your code:
from flask import Flask
from flask_zookeeper import FlaskZookeeperClient
app = Flask(__name__)
fzc = FlaskZookeeperClient(app)
You can take a look at tests/test_base.py for more complete example.
You can also take a look at tests/test_blueprint.py for an example using Flask’s application factories and blueprints.
About setting up
Flask-Zookeeper uses additional variables which can be set in the app.config:
Main values
KAZOO_HOSTS: Zookeeper quorum server list separated by commas (default:
127.0.0.1:2181).KAZOO_START_TIMEOUT: Time in seconds to wait for connection to succeed (default:
15).KAZOO_SESSION_TIMEOUT: The longest to wait for a Zookeeper connection (default:
10.0).KAZOO_RETRY: Dict of options to use for retrying the connection to Zookeeper (default:
{'max_delay': 3600}).
ACL configuration
Zookeeper allow to set ACL. To enable this feature, set
KAZOO_ACL_USERNAME and KAZOO_ACL_PASSWORD in the app.config.
KAZOO_ACL_USERNAME: Username to use for the ACL.
KAZOO_ACL_PASSWORD: A plain-text password to hash.
KAZOO_ACL_READ: Read permission (default:
False).KAZOO_ACL_WRITE: Write permission (default:
False).KAZOO_ACL_CREATE: Create permission (default:
False).KAZOO_ACL_DELETE: Delete permission (default:
False).KAZOO_ACL_ADMIN: Admin permission (default:
False).KAZOO_ACL_ALL: All permissions (default:
False).
You can take a look at tests/test_acl.py for a complete example.
License
Apache License 2.0
Metadata
Release files for flask-zookeeper 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| flask-zookeeper-0.0.8.tar.gz | 3.6 kB | Without provenance | Details |
Release files / flask-zookeeper-0.0.8.tar.gz
| Download URL | flask-zookeeper-0.0.8.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4becec676663111e8040b6f94b092ae196a4f1f0ac924c9345757b633477ed48
|
|
BLAKE2b-256 checksum How to use checksums |
b8801d8620f1211e537614eaef9f48731451aeb0741ac64d4fc93e0d0364baa8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for flask-zookeeper 0.0.8
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.