Skip to main content

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()

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 details)

Uploaded Source

Built Distributions

ketama-0.1.1-cp310-cp310-macosx_10_9_universal2.whl (43.2 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

ketama-0.1.1-cp39-cp39-macosx_10_9_universal2.whl (22.8 kB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

ketama-0.1.1-cp38-cp38m-manylinux1_x86_64.whl (36.0 kB view details)

Uploaded CPython 3.8m

ketama-0.1.1-cp38-cp38-macosx_11_0_universal2.whl (22.9 kB view details)

Uploaded CPython 3.8 macOS 11.0+ universal2 (ARM64, x86-64)

ketama-0.1.1-cp38-cp38-macosx_10_9_x86_64.whl (12.5 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

ketama-0.1.1-cp37-cp37m-manylinux1_x86_64.whl (35.5 kB view details)

Uploaded CPython 3.7m

ketama-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl (12.5 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

ketama-0.1.1-cp36-cp36m-manylinux1_x86_64.whl (35.5 kB view details)

Uploaded CPython 3.6m

ketama-0.1.1-cp36-cp36m-macosx_10_9_x86_64.whl (12.5 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

ketama-0.1.1-cp35-cp35m-manylinux1_x86_64.whl (35.5 kB view details)

Uploaded CPython 3.5m

ketama-0.1.1-cp35-cp35m-macosx_10_6_intel.whl (20.6 kB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

ketama-0.1.1-cp34-cp34m-manylinux1_x86_64.whl (35.3 kB view details)

Uploaded CPython 3.4m

ketama-0.1.1-cp34-cp34m-macosx_10_6_intel.whl (20.5 kB view details)

Uploaded CPython 3.4m macOS 10.6+ intel

File details

Details for the file ketama-0.1.1.tar.gz.

File metadata

  • Download URL: ketama-0.1.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ketama-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ca3608ba3fcd306af4c782002e4980956b6f825a090de29732d7d8666924c769
MD5 d02474b94322b51e78c0b3c7f9558d4c
BLAKE2b-256 a79a05d4b93f223406293a1f1507630b7d0f56a8301319bcbf4dd2dfb3a0e856

See more details on using hashes here.

File details

Details for the file ketama-0.1.1-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

  • Download URL: ketama-0.1.1-cp310-cp310-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 43.2 kB
  • Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for ketama-0.1.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 94ace8dc0adb4fb8f0b05b39b33f7b3b7a69a233af8a4ea10c0dd24d39906a4b
MD5 0e1128b22396fc19b3190fb8c5e751a4
BLAKE2b-256 e46bdb360c13d1ed45f65478ee94806ff06e6f161d28ede33a4412a6068149a3

See more details on using hashes here.

File details

Details for the file ketama-0.1.1-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

  • Download URL: ketama-0.1.1-cp39-cp39-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for ketama-0.1.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7dd44ccfb9cfe024c4f0f8f20a96973f9417eeb52f31d2d8cb6bd7e384f895b4
MD5 5d4db50ae1ba4ef122e11d2238202afa
BLAKE2b-256 85091911c6b35f142cbdbd7deca3230441f127c2580308748e64f4d8543b120e

See more details on using hashes here.

File details

Details for the file ketama-0.1.1-cp38-cp38m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ketama-0.1.1-cp38-cp38m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: CPython 3.8m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ketama-0.1.1-cp38-cp38m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3409de39e418f9c39d15fe7ffb50832f293a19a0c26600b014d743e073ed06bf
MD5 7e55433da4646e53b3cd6fa310390193
BLAKE2b-256 6af15faee9492b999e65c5c48cc771914e3b6ecd4cae6aa6f57bf0082f1660a0

See more details on using hashes here.

File details

Details for the file ketama-0.1.1-cp38-cp38-macosx_11_0_universal2.whl.

File metadata

  • Download URL: ketama-0.1.1-cp38-cp38-macosx_11_0_universal2.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: CPython 3.8, macOS 11.0+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for ketama-0.1.1-cp38-cp38-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 0abcf681733eb667ee1fe3ddabc6ff18e473ee16eeff87c43f5e33ba61968d6c
MD5 7e71f2e606a19b46dab4faae1e781fdd
BLAKE2b-256 fb021af7f7e1d598c0970845acfe11aeaaa7d2ca61d31ad9f3dbe23f59dfdff9

See more details on using hashes here.

File details

Details for the file ketama-0.1.1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: ketama-0.1.1-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ketama-0.1.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bd9fa73ba324f435b9ff64a0a32b0ac8250445cd92a7970200169de99b8b4465
MD5 7e38c75f9ae63c91928b877cc687315c
BLAKE2b-256 99254c74d04ce5e9cb23760934b84282325567c425da2ed8188f79bf29459cf3

See more details on using hashes here.

File details

Details for the file ketama-0.1.1-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ketama-0.1.1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 35.5 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ketama-0.1.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f903912da650f08dccbf4743405b5663bcff0411032fd0ab5c2037c77701d03a
MD5 60d465e05742e741e9c32ab185941b04
BLAKE2b-256 5bfee8a11c913367ca02d0ad3a5c0b04814cf6947070f33a78958f1cb0bf820f

See more details on using hashes here.

File details

Details for the file ketama-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: ketama-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ketama-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 749de34bb6c249e73e091715aac158505540827abbbf223dea8453f5662fef5e
MD5 e7a6ef4acdebff12ac2d857aae5898f8
BLAKE2b-256 043e1fde4cedcc630cce81d90796a37bdc7395a565e2c0c0b7c99ddf15c8ea68

See more details on using hashes here.

File details

Details for the file ketama-0.1.1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ketama-0.1.1-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 35.5 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ketama-0.1.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d87c8c55088d87abdba09f8345baffcb1620ae7b3f801e09b427059ebc5deeb3
MD5 9bd8b747191f6effddffefe6b779c771
BLAKE2b-256 5b381fa83589fd3b7a3fbef2e500635a7d498184c41d779d6acc79929ea41743

See more details on using hashes here.

File details

Details for the file ketama-0.1.1-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: ketama-0.1.1-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ketama-0.1.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c4432d60168c25d925a998a69d69fc2a5d4a067f3d4988856f9f18b775763208
MD5 cbacf5a487d3d3d6f2fd11ea9b9c84a2
BLAKE2b-256 445882b8520e19362598cf276e10d403afaf5b96086130728c073fae81228637

See more details on using hashes here.

File details

Details for the file ketama-0.1.1-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ketama-0.1.1-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 35.5 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ketama-0.1.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5832e79ee53078921bae2eb95b24e5fd47e41e5cc3a7cde073b114ec73fc71e6
MD5 19de5def829d59a5dcd31969eb2ae1fe
BLAKE2b-256 e6cc53e9733aaf368b98fae5d4e89237103fa1d4bc5e960b8936bdbaadf30557

See more details on using hashes here.

File details

Details for the file ketama-0.1.1-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

  • Download URL: ketama-0.1.1-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: CPython 3.5m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ketama-0.1.1-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 28b62e9258d24c4dc2c6bffbee1edcf6f3143b04799d83f6d75cd9ab3d538a52
MD5 07cd862900acfbc76cba301c6d2de7f2
BLAKE2b-256 262fd0142a5e12ff8eb650f32f2e2c140bc7eb8869b60c913da977a94ae6213c

See more details on using hashes here.

File details

Details for the file ketama-0.1.1-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ketama-0.1.1-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: CPython 3.4m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ketama-0.1.1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8e55188a0aa410ef466a4a8d35859972d2465b3255ad4dda958468fc956a44c5
MD5 2a0cf611a8edc1a82abcb4e3692d5624
BLAKE2b-256 c428615a4cc9a046ee1bf02ac9014fef1cff1b1145fc3e474996887499fb2667

See more details on using hashes here.

File details

Details for the file ketama-0.1.1-cp34-cp34m-macosx_10_6_intel.whl.

File metadata

  • Download URL: ketama-0.1.1-cp34-cp34m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: CPython 3.4m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ketama-0.1.1-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 293e461cef5aa8423869bde8051efc8e9c87b7a007b0600e828048b9d7103be6
MD5 f078bc73727fe6ddaedbe0873c1e4a23
BLAKE2b-256 321f0fd6b4f2386b50ab0d8fd47021c9591c25309ce99611ba43f09c4b83fc71

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page