hashring
Implements consistent hashing in Python (using md5 as hashing function).
What it is and what it does
Hashring provides a consistent hashing implementation for Python, using md5 as its underlying hash function. It solves the problem of distributing keys across a set of nodes (such as cache servers or database shards) in a way that minimizes the number of keys that need to be remapped when the set of nodes changes. This is particularly useful in distributed systems where you want stable key-to-node assignments despite node additions or removals.
The package has no external runtime dependencies and installs as a pure Python wheel, making it lightweight to add to any project. However, it is no longer actively maintained—the last commit was in November 2021 and the most recent release dates to April 2015. While it is classified as Production/Stable, you should be aware that bugs or compatibility issues with modern Python versions will not receive fixes.
Use it for:
- Distributing cache keys across multiple Memcached or Redis nodes with minimal key remapping on node failure or addition.
- Assigning database shard keys in a distributed database cluster to balance load while maintaining consistent routing.
- Load-balancing requests to backend servers in a way that keeps related requests routed to the same server.
- Partitioning data across multiple storage nodes in a distributed system while minimizing data movement on topology changes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements consistent hashing in Python using md5 as the hashing function, enabling distributed systems to map keys to nodes in a way that minimizes remapping when nodes are added or removed.
Yes, if you need consistent hashing and are comfortable with an unmaintained library. The code is simple and stable, with no known vulnerabilities and low install friction. However, verify that md5 hashing meets your security and collision-tolerance requirements, and test compatibility with your target Python version—the package's classifiers only list support up to Python 3.4, and there is no active maintenance to address issues with newer versions.
Install
hashring on PyPI
pip
pip install hashringuv
uv add hashringpoetry
poetry add hashringInstalling hashring
Before you install
Installation is straightforward with no runtime dependencies. However, the package is abandoned—last commit was 2021-11-14 and no releases since 2015-04-14. It remains marked Production/Stable but receives no maintenance.
License in practice
BSD license is permissive, allowing commercial and private use with minimal restrictions, making it safe from a licensing standpoint for most projects.
Quickstart
pip install hashring
from hashring import HashRing
hr = HashRing(nodes=['node1', 'node2', 'node3'])
node = hr.get_node('some_key')
Verify before relying
- Whether md5 hashing is cryptographically sufficient for your use case (md5 is not collision-resistant)
- Compatibility with Python versions beyond 3.4 (classifiers list only up to 3.4)
- Whether the implementation handles virtual nodes or other advanced consistent hashing features
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 4,140 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 75,180/month — #14,744 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: hashring-1.5.1-py2.py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
clandestinedImplements rendezvous hashing to locate objects…
permissive · top 5,000 on PyPI
uhashringuhashring implements consistent hashing in pure…
permissive · top 15,000 on PyPI
dict-hashGenerates consistent hashes for Python…
permissive · top 15,000 on PyPI
dirhashComputes a single hash value for an entire…
permissive · top 5,000 on PyPI
poseidon-pyPoseidon hash implementation in Python with a…
unclear · top 15,000 on PyPI
checksumdirComputes a single hash digest of all file…
permissive · top 15,000 on PyPI
pwdlibProvides a modern, easy-to-use wrapper for…
permissive · top 5,000 on PyPI
murmurhashProvides fast MurmurHash2 hashing through…
permissive · top 1,000 on PyPI
siphashProvides a Python implementation of SipHash, a…
permissive · top 15,000 on PyPI
ImageHashImageHash computes perceptual fingerprints of…
permissive · top 5,000 on PyPI