proxenos
A Python toolkit for Rendezvous/Highest Random Weight (HRW) hash based routing.
>>> import proxenos.mappers.consul
>>> import proxenos.rendezvous
>>> mapper = proxenos.mappers.consul.ConsulClusterMapper(
... host='localhost', port=8500)
>>> mapper.update()
>>> mapper.cluster
{SocketAddress(host=IPAddress('::'), port=8000),
SocketAddress(host=IPAddress('::'), port=8001),
SocketAddress(host=IPAddress('::'), port=8300),
SocketAddress(host=IPAddress('::'), port=8500)}
>>> mapper.select('github.com', proxenos.rendezvous.HashMethod.SIPHASH)
SocketAddress(host=IPAddress('::'), port=8001)
$ proxenos select -b consul -h localhost -p 8500 github.com
0.0.0.0:8300
Features
Support for multiple service discovery backends possible. Currently only support for Consul is implemented, but other backends coming eventually.
Supports many different hash functions and PRFs. The default hashing method is the SipHash PRF.
Provides a command-line interface for quickly testing/debugging node selection.
Installation
$ pip install proxenos
$ # If you'd like Murmur3 support, use:
$ pip install proxenos[murmur]
Notes
proxenos uses Python’s PRNG for calculating the weight of nodes in a cluster, rather than using a linear congruential generator (LCG) as described in the original paper on Rendezvous hashing. Seeded weights generated are limited to sys.maxsize, which means the resulting weights will differ depending on the platform architecture.
Similar projects
Metadata
Release files for proxenos 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| proxenos-0.0.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for proxenos-0.0.3-py2.py3-none-any.whl |
Release files / proxenos-0.0.3-py2.py3-none-any.whl
| Download URL | proxenos-0.0.3-py2.py3-none-any.whl |
|---|---|
| Size | 33.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
07f5d4adb852c9d88efaa9118987a0bf3c7fac3c6fbb2856de22c6e5a722dd4a
|
|
BLAKE2b-256 checksum How to use checksums |
dacdc082455bb19aff3bb48f548a867e185638e222ad038294ef312247cb62aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for proxenos 0.0.3
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.