Skip to main content
pyketama
========
![build](https://img.shields.io/travis/maralla/pyketama.svg)

pyketama is a cython implementation of ketama consistent hashing algorithm.


Install
=======

```bash
pip install pyketama
```


Usage
=====

```python
import ketama

data = ["127.0.0.1:12211", "127.0.0.1:12212"]
continuum = ketama.Continuum(data)
print(continuum['test'])


# with weight, (key, weith)
data = [("127.0.0.1:12211", 400), ("127.0.0.1:12212", 500)]
continuum = ketama.Continuum(data)
print(continuum['test'])


# with value, (key, value, weight)
data = [("node1", "127.0.0.1:12211", 400), ("node2", "127.0.0.1:12212", 500)]
continuum = ketama.Continuum(data)
print(continuum['test'])


# set item like dict
continuum = ketama.Continuum()
continuum['tom'] = 123
continuum['jerry'] = "hello world"
print(continuum['test'])

# with weight (key, weight)
continuum = ketama.Continuum()
continuum[('tom', 100)] = 123
continuum[('jerry', 300)] = "hello world"
print(continuum['test'])
```

Metadata

Release files for pyketama 0.2.1

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

Source distribution (sdist)

Source distribution for pyketama 0.2.1
File Size Uploaded Provenance
pyketama-0.2.1.tar.gz 37.3 kB Without provenance Details

Release files / pyketama-0.2.1.tar.gz

Download URL pyketama-0.2.1.tar.gz
Size 37.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2e05502714ec06076e03745a96f1656fa369f8cc384d9e1147d9e540c082d04c
BLAKE2b-256 checksum
How to use checksums
2c5a095dc1543a0607d98b7dc6d495c3af548847f4da76d979c7c30c784ac724
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pyketama 0.2.1

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.

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 release file No provenance

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