Python bindings for Ketama consistent hash library
Project description
Python bindings for Ketama consistent hash library.
Example
from ketama import Ketama
with open("ketama.conf", "w") as fp:
fp.write("127.0.0.1:1\t400\n")
fp.write("127.0.0.1:2\t600\n")
fp.write("127.0.0.1:3\t600\n")
def main():
k = Ketama("ketama.conf")
key_hash, server = k.get_server("1")
assert server == "127.0.0.1:3"
key_hash, server = k.get_server("3")
assert server != "127.0.0.1:1"
if __name__ == '__main__':
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ketama-0.1.1.tar.gz
(15.6 kB
view hashes)
Built Distributions
Close
Hashes for ketama-0.1.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94ace8dc0adb4fb8f0b05b39b33f7b3b7a69a233af8a4ea10c0dd24d39906a4b |
|
MD5 | 0e1128b22396fc19b3190fb8c5e751a4 |
|
BLAKE2b-256 | e46bdb360c13d1ed45f65478ee94806ff06e6f161d28ede33a4412a6068149a3 |
Close
Hashes for ketama-0.1.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7dd44ccfb9cfe024c4f0f8f20a96973f9417eeb52f31d2d8cb6bd7e384f895b4 |
|
MD5 | 5d4db50ae1ba4ef122e11d2238202afa |
|
BLAKE2b-256 | 85091911c6b35f142cbdbd7deca3230441f127c2580308748e64f4d8543b120e |
Close
Hashes for ketama-0.1.1-cp38-cp38m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3409de39e418f9c39d15fe7ffb50832f293a19a0c26600b014d743e073ed06bf |
|
MD5 | 7e55433da4646e53b3cd6fa310390193 |
|
BLAKE2b-256 | 6af15faee9492b999e65c5c48cc771914e3b6ecd4cae6aa6f57bf0082f1660a0 |
Close
Hashes for ketama-0.1.1-cp38-cp38-macosx_11_0_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0abcf681733eb667ee1fe3ddabc6ff18e473ee16eeff87c43f5e33ba61968d6c |
|
MD5 | 7e71f2e606a19b46dab4faae1e781fdd |
|
BLAKE2b-256 | fb021af7f7e1d598c0970845acfe11aeaaa7d2ca61d31ad9f3dbe23f59dfdff9 |
Close
Hashes for ketama-0.1.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd9fa73ba324f435b9ff64a0a32b0ac8250445cd92a7970200169de99b8b4465 |
|
MD5 | 7e38c75f9ae63c91928b877cc687315c |
|
BLAKE2b-256 | 99254c74d04ce5e9cb23760934b84282325567c425da2ed8188f79bf29459cf3 |
Close
Hashes for ketama-0.1.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f903912da650f08dccbf4743405b5663bcff0411032fd0ab5c2037c77701d03a |
|
MD5 | 60d465e05742e741e9c32ab185941b04 |
|
BLAKE2b-256 | 5bfee8a11c913367ca02d0ad3a5c0b04814cf6947070f33a78958f1cb0bf820f |
Close
Hashes for ketama-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 749de34bb6c249e73e091715aac158505540827abbbf223dea8453f5662fef5e |
|
MD5 | e7a6ef4acdebff12ac2d857aae5898f8 |
|
BLAKE2b-256 | 043e1fde4cedcc630cce81d90796a37bdc7395a565e2c0c0b7c99ddf15c8ea68 |
Close
Hashes for ketama-0.1.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d87c8c55088d87abdba09f8345baffcb1620ae7b3f801e09b427059ebc5deeb3 |
|
MD5 | 9bd8b747191f6effddffefe6b779c771 |
|
BLAKE2b-256 | 5b381fa83589fd3b7a3fbef2e500635a7d498184c41d779d6acc79929ea41743 |
Close
Hashes for ketama-0.1.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4432d60168c25d925a998a69d69fc2a5d4a067f3d4988856f9f18b775763208 |
|
MD5 | cbacf5a487d3d3d6f2fd11ea9b9c84a2 |
|
BLAKE2b-256 | 445882b8520e19362598cf276e10d403afaf5b96086130728c073fae81228637 |
Close
Hashes for ketama-0.1.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5832e79ee53078921bae2eb95b24e5fd47e41e5cc3a7cde073b114ec73fc71e6 |
|
MD5 | 19de5def829d59a5dcd31969eb2ae1fe |
|
BLAKE2b-256 | e6cc53e9733aaf368b98fae5d4e89237103fa1d4bc5e960b8936bdbaadf30557 |
Close
Hashes for ketama-0.1.1-cp35-cp35m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28b62e9258d24c4dc2c6bffbee1edcf6f3143b04799d83f6d75cd9ab3d538a52 |
|
MD5 | 07cd862900acfbc76cba301c6d2de7f2 |
|
BLAKE2b-256 | 262fd0142a5e12ff8eb650f32f2e2c140bc7eb8869b60c913da977a94ae6213c |
Close
Hashes for ketama-0.1.1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e55188a0aa410ef466a4a8d35859972d2465b3255ad4dda958468fc956a44c5 |
|
MD5 | 2a0cf611a8edc1a82abcb4e3692d5624 |
|
BLAKE2b-256 | c428615a4cc9a046ee1bf02ac9014fef1cff1b1145fc3e474996887499fb2667 |
Close
Hashes for ketama-0.1.1-cp34-cp34m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 293e461cef5aa8423869bde8051efc8e9c87b7a007b0600e828048b9d7103be6 |
|
MD5 | f078bc73727fe6ddaedbe0873c1e4a23 |
|
BLAKE2b-256 | 321f0fd6b4f2386b50ab0d8fd47021c9591c25309ce99611ba43f09c4b83fc71 |