Python cluster client for the official redis cluster. Redis 3.0+.

Overview

redis-py-cluster

This client provides a client for redis cluster that was added in redis 3.0.

This project is a port of redis-rb-cluster by antirez, with a lot of added functionality. The original source can be found at https://github.com/antirez/redis-rb-cluster

Build Status Coverage Status PyPI version

The branch master will always contain the latest unstable/development code that has been merged from Pull Requests. Use the latest commit from master branch on your own risk, there is no guarantees of compatibility or stability of non tagged commits on the master branch. Only tagged releases on the master branch is considered stable for use.

Python 2 Compatibility Note

This library follows the announced change from our upstream package redis-py. Due to this, we will follow the same python 2.7 deprecation timeline as stated in there.

redis-py-cluster 2.1.x will be the last major version release that supports Python 2.7. The 2.1.x line will continue to get bug fixes and security patches that support Python 2 until August 1, 2020. redis-py-cluster 3.0.x will be the next major version and will require Python 3.5+.

Documentation

All documentation can be found at https://redis-py-cluster.readthedocs.io/en/master

This Readme contains a reduced version of the full documentation.

Upgrading instructions between each released version can be found here

Changelog for next release and all older releases can be found here

Installation

Latest stable release from pypi

$ pip install redis-py-cluster

This major version of redis-py-cluster supports redis-py >=3.0.0, <4.0.0.

Usage example

Small sample script that shows how to get started with RedisCluster. It can also be found in examples/basic.py

>>> from rediscluster import RedisCluster

>>> # Requires at least one node for cluster discovery. Multiple nodes is recommended.
>>> startup_nodes = [{"host": "127.0.0.1", "port": "7000"}]

>>> rc = RedisCluster(startup_nodes=startup_nodes, decode_responses=True)

>>> rc.set("foo", "bar")
True
>>> print(rc.get("foo"))
'bar'

License & Authors

Copyright (c) 2013-2020 Johan Andersson

MIT (See docs/License.txt file)

The license should be the same as redis-py (https://github.com/andymccurdy/redis-py)

Comments
  • Update lib to support redis-py up to 3.5.x release

    Update lib to support redis-py up to 3.5.x release

    I want to move to latest version of redis-py (3.3.x) version. However I don't see supporting version with redis-py-cluster. I see that the latest version only supports till <3.1.0 Asif

    opened by aasifalam 38
  • Add PUBSUB * commands, sending to all nodes

    Add PUBSUB * commands, sending to all nodes

    PUBSUB commands added to redis-py in commit 3f4ac6, which should be sent to all nodes (https://redis.io/commands/pubsub, https://redis.io/topics/pubsub)

    opened by AngusP 30
  • Parallel execution of packed pipelined commands against multiple nodes

    Parallel execution of packed pipelined commands against multiple nodes

    I am just starting to get a better understanding of the code, but it seems so far this client implementation of pipelining doesn't pack the commands to a node in a single request as it does in redis-py here:

    https://github.com/andymccurdy/redis-py/blob/master/redis/client.py#L2445-L2447

    It seems like you should be able to pack all the commands and send them to a specific node so long as each command that is queued up is being routed to a key, or in the case of an MGET, is rewritten into batches of MGET calls that route to a correct node. In addition, instead of a simple for loop to go through the commands, it seems like you could also use a thread pool to execute the batched commands against each node in parallel or at least up to a certain threshold of parallel execution.

    I realize this significantly increases the complexity of the code but it seems like it could greatly improve performance of the redis-py-cluster library, bringing it back up to par with redis-py.

    If this seems like a reasonable direction to go, I could look into taking a first stab at implementing it as a proof of concept.

    enhancement 
    opened by 72squared 28
  • add redis cluster management commands: slots, info and nodes

    add redis cluster management commands: slots, info and nodes

    A quick implementation.

    The usage will be: rcm = RedisClusterMgt(startup_nodes); rcm.info()

    There are some reasons behind the design:

    1. Since the class RedisClusterMgt will focus on cluster operation specific commands, it makes no sense to pass cluster command every time. Instead, directly calling info or nodes will be more concise. This does make newbies confusing because it is different from the official documentation. But they can grasp the concept quickly IMO.
    2. Currently only three commands are implemented which are the ones related to meta data retrieval. The necessity of other types of commands is unknown since redis-tri.rb can do them well especially for complex commands like addslots

    I am open for discussion. And if the current design is enough, I can work on some other commands and the tests.

    Thanks!

    opened by iandyh 26
  • Major refactoring (0.2.0)

    Major refactoring (0.2.0)

    This PR will lead up to 0.2.0 release. #39

    TODO:

    • [x] Fix TODO:s in code
    • [x] Fix pubsub
    • [x] Fix pipelines
    • [x] Merge gevent PR
    • [x] More code cleanup
    • [x] Fix all tests
    • [x] Clean out decorators.py
    • [x] More tests for test_cluster_obj.py
    • [x] Tests for Nodemanager
    • [x] Tests for ClusterConnectionPool
    opened by Grokzen 22
  • ERROR sending 'cluster slots'

    ERROR sending 'cluster slots'

    rc = StrictRedisCluster(startup_nodes=redisnodes)
    

    File "build/bdist.macosx-10.6-intel/egg/rediscluster/client.py", line 183, in init File "build/bdist.macosx-10.6-intel/egg/rediscluster/connection.py", line 143, in init File "build/bdist.macosx-10.6-intel/egg/rediscluster/nodemanager.py", line 183, in initialize rediscluster.exceptions.RedisClusterException: ERROR sending 'cluster slots' command to redis server: {'host': '10.10.65.68', 'port': 8813}

    我直接用命令行是没有问题的 127.0.0.1:8813> cluster slots

      1. (integer) 8192
      2. (integer) 12287
        1. "10.10.65.42"
        2. (integer) 8812
        1. "10.10.65.68"
        2. (integer) 8812
      1. (integer) 0
      2. (integer) 4095
        1. "10.10.65.15"
        2. (integer) 8810
        1. "10.10.65.23"
        2. (integer) 8810
      1. (integer) 4096
      2. (integer) 8191
        1. "10.10.65.23"
        2. (integer) 8811
        1. "10.10.65.15"
        2. (integer) 8811
      1. (integer) 12288
      2. (integer) 16383
        1. "10.10.65.68"
        2. (integer) 8813
        1. "10.10.65.42"
        2. (integer) 8813
    opened by benben17 21
  • Scan_iter only get next cursor from 1 nodes

    Scan_iter only get next cursor from 1 nodes

    I'm not sure this is a bug or intended behavior, scan_iter only iterate from cursor in the last Redis nodes (https://github.com/Grokzen/redis-py-cluster/blob/c2d305a59e237e286df2c26d6e82bd5364f34cfe/rediscluster/client.py#L350), resulting the iteration isn't 100% complete with all keys on Redis.

    Can anyone clarify?

    opened by RedWhiteMiko 21
  • Implemented READONLY mode

    Implemented READONLY mode

    By default, Redis Cluster always returns MOVE redirection response on accessing slave node. To overcome this limitation for scaling read, I implemented READONLY mode and its releated tests.

    Please refer to docs/Readonly_mode.md for details.

    opened by mumumu 19
  • rediscluster.exceptions.RedisClusterException: Slot

    rediscluster.exceptions.RedisClusterException: Slot "13145" not covered by the cluster. "skip_full_coverage_check=True"

    Hello,

    I am using redis-py-cluster 2.0.0 and AWS Elasticache Clustered Mode Redis.

    When I initialize my RedisCluster client with skip_full_coverage_check=False, I get the following error: redis.exceptions.ResponseError: unknown command `CONFIG`, with args beginning with: `GET`, `cluster-require-full-coverage`,

    It gets resolved when I use skip_full_coverage_check=True.

    After this, I tried primary failover by initiating failover in one of the shards. After the failover finished one of my containers connecting with the Redis started throwing errors like below:

    rediscluster.exceptions.RedisClusterException: Slot "13145" not covered by the cluster. "skip_full_coverage_check=True"

    Strange thing is that the other containers were working fine after the failover. What can be the issue?

    Thanks, Umang.

    opened by umang92 17
  • Fix CLUSTERDOWN when request to a node which quits the cluster

    Fix CLUSTERDOWN when request to a node which quits the cluster

    After a node migrates all slots it owns and quits the cluster, a 'CLUSTERDOWN' error possibly appears that an operation on key in the slot which was owned by that node. RedisCluster should recover under the circumstance.

    By the way, I found the refresh_table_asap attribute is somewhat hard to trace. In my test case, its value mutated between this 2 get calls

    # L318
    conn_b.send_command('set', 'h-893', 'I am in slot 0')
    
    # L319
    assert b'I am in slot 0' == rc.get('h-893')
    
    # self.refresh_table_asap is True
    
    # L320
    assert b'bar' == rc.get('foo')
    
    # self.refresh_table_asap is False
    

    As a result if L320 is removed the test won't pass, because refresh_table_asap is True, and therefore the last get (L333) would fix the slots mapping.

    Do you have any plans about refactoring the error recovering in send_cluster_command? May I help with that?

    opened by zheplusplus 17
  • determine_node first while in pipeline and block some commands by node flag

    determine_node first while in pipeline and block some commands by node flag

    1. determine_node before determin_slot while doing pipeline, the same logic with StrictRedisCluster.execute_command. some commands do not need to calc slot with key, such as cluster_countkeysinslot;

    2. block commands by node flag "blocked", "all-nodes", "all-masters";

    3. delete the first useless arg for utils.blocked_command;

    opened by ZisZ 16
  • ClusterWithReadReplicasConnectionPool with read_from_replicas causes dump.

    ClusterWithReadReplicasConnectionPool with read_from_replicas causes dump.

    We are using redis-cluster py and have set up connection pool with class ClusterWithReadReplicasConnectionPool. One of the arguments that is passed is read_from_replicas. An object gets created. But when a get is performed and the required node is not found in the pool, a make_connection is called. This internally calls SSLConnection class from redis/connection.py which does not recognise read_from_replicas.

    "Traceback (most recent call last):", "File "/opt/directory/venv/lib/python3.6/site-packages/rediscluster/connection.py", line 364, in get_connection_by_node
    connection = self._available_connections.get(node["name"], []).pop()", "IndexError: pop from empty list", "During handling of the above exception, another exception occurred:", "Traceback (most recent call last):", " File "/opt/directory/venv/lib/python3.6/site-packages/rediscluster/client.py", line 615, in _execute_command
    connection = self.connection_pool.get_connection_by_node(node)", " File "/opt/directory/venv/lib/python3.6/site-packages/rediscluster/connection.py", line 366, in get_connection_by_node
    connection = self.make_connection(node)", " File "/opt/directory/venv/lib/python3.6/site-packages/rediscluster/connection.py", line 273, in make_connection
    connection = self.connection_class(host=node["host"], port=node["port"], **self.connection_kwargs)", " File "/opt/directory/venv/lib/python3.6/site-packages/rediscluster/connection.py", line 89, in init
    super(SSLClusterConnection, self).init(**kwargs)", " File "/opt/directory/venv/lib/python3.6/site-packages/redis/connection.py", line 828, in init
    super(SSLConnection, self).init( ** kwargs)", "TypeError: init() got an unexpected keyword argument 'read_from_replicas'

    Is read_from_replicas a valid argument for ClusterWithReadReplicasConnectionPool?

    Many thanks in advance.

    opened by prabhakarjuzgar 0
  • Speed up mget and other similar calls, by applying the pipeline parrelllel exection speedup under the hood.

    Speed up mget and other similar calls, by applying the pipeline parrelllel exection speedup under the hood.

    As far as I can tell, the current implementation for commands like mget is to unroll them into a sequential series of get calls, to ensure the correctness, but that leads to very slow performance for calls for a large quantity of keys. See (https://github.com/Grokzen/redis-py-cluster/issues/375)

    Would it be possible to apply the parallel execution speed ups that are used for pipelines though, so that the unrolled series of gets only need to block once on all of the calls at once, rather than sequentially waiting on many round trips to 1 node at a time?

    opened by AlexBoyd 1
  • Allow EVAL/EVALSHA to read from replicas

    Allow EVAL/EVALSHA to read from replicas

    Based on this comment https://github.com/redis/redis/issues/8537#issuecomment-784655245 it looks like it should be possible to send an EVAL/EVALSHA command to a replica in cluster mode (as long as the script commands are all readonly). It looks like this library explicitly prevents all EVAL/EVALSHA commands from running against replicas. Is that correct? If so, would it be possible to add in a new feature to allow EVAL/EVALSHA to run on replicas? Thanks

    opened by rtkefreure 0
  • Bugfix/fix move errors

    Bugfix/fix move errors

    2 bug fixes here and a logging improvement and a testing improvement: 1/ Startup nodes were not being populated correctly when initialising the node manager. 2/ Handling of SlotNotCoveredError was raising the exception one attempt too early, before it had used all allowed TTL. 3/ When a command is executed and it succeeds it's nice not to have a bunch of error exception logs. Instead only log the exception if all attempts are used up, otherwise log a warning. It's useful to be able to differentiate between a command that failed fatally, and one that was ultimately successful, with perhaps some warnings about short lived problems along the way. 4/ It took me forever to work out what kind of cluster I need to run the tests against. It was fairly simple in the end, but I have included a docker_compose.yml file which can be used to start the redis cluster for the tests.

    Could you could also give a rationale for picking a random node when a timeout error happens? I am also curious as to what conditions it is trying to handle. Every time I have seen this in action, picking a different node, just results in a moved error, pointing the client back to the original node. So it's unclear to me why it doesn't just keep trying the correct node, instead of picking an incorrect node only to be redirect back.

    opened by JonathanWylie 0
  • Stop leaking connections when pool is full

    Stop leaking connections when pool is full

    Fixes https://github.com/Grokzen/redis-py-cluster/issues/458

    When our connection pool is full (there are no available connections) we can run into a case where we leak perfectly useable connections. This essentially reduces the size of our connection pool every time it happens, as it can slowly leak away our unused connections until we don't have enough connections available to cope with our workload.

    This is particularly problematic when preparing connections for a pipeline, since we can potentially request (and leak) a large number of connections in one go.

    This change makes sure that before raising an exception if there are no available connections we return back all connections we've checked to the pool. In cases where we can't guarantee the connections we'd return to the pool are in a safe state we just add back None objects to the pool so at least the effective size of the connection pool remains unchanged.

    opened by FranGM 0
Releases(2.1.3)
  • 2.1.3(May 30, 2021)

    2.1.3 (May 30 2021)

    * Add example script pipelin-readonly-replica.py to show how to use replica nodes to offload read commands from primary node
    * max_connection now defaults to 50 in ClusterBlockingConnectionPool to avoid issue with infinite loop in queue mechanism
    * Using read replica for read commands inside pipeline is now better supported. Feature might be unstable to use as own risk.
    * Fixed that in some cases where ConnectionError is raised, a non existing connection was attempted to be disconnected and caused a sub exception to be raised.
    
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-2.1.3.tar.gz(45.79 KB)
    redis_py_cluster-2.1.3-py2.py3-none-any.whl(41.57 KB)
  • 2.1.2(Apr 18, 2021)

  • 2.1.1(Apr 18, 2021)

    2.1.1 (Apr 18 - 2021)

    This content can also be found in docs/release-notes.rst

    * ClusterPipeline is now exposed when doing "from rediscluster import *"
    * Fix issue where connection would be None in some cases when connection pool fails to initialize
    * Ported in a fix from redis-py where it now checks if a connection is ready or not before returning the connection for usage
    * ClusterFailover command option is no longer mandatory but optional as it is intended
    * Fixed "SLOWLOG GET" kwarg command where it failed on decode_responses
    * BaseException is now caught when executing commands and it will disconnect and the connection before raising the exception.
    * Logging exception on ReseponseError when doing the initial connection to the startup_nodes instances
    
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-2.1.1.tar.gz(42.64 KB)
    redis_py_cluster-2.1.1-py2.py3-none-any.whl(41.16 KB)
  • 2.1.0(Sep 25, 2020)

    2.1.0 (September 26, 2020)

    This content can also be found in docs/release-notes.rst

    * Add new config option for Client and Pipeline classes to controll how many attempts will be made before bailing out from a ClusterDownError.
      Use "cluster_down_retry_attempts=<int>" when creating the client class to controll this behaviour.
    * Updated redis-py compatbile version to support any version in the major version 3.0.x, 3.1.x, 3.2.x, 3.3.x., 3.4.x, 3.5.x (#326)
      It is always recommended to use the latest version of redis-py to avoid issues and compatiblity problems.
    * Fixed bug preventing reinitialization after getting MOVED errors
    * Add testing of redis-esrver 6.0 versions to travis and unit tests
    * Add python 2.7 compatiblity note about deprecation and upcomming changes in python 2.7 support for this lib
    * Updated tests and cluster tests versions of the same methods to latest tests from upstream redis-py package
    * Reorganized tests and how cluster specific tests is written and run over the upstream version of the same test to make it easier
      and much faster to update and keep them in sync over time going into the future (#368)
    * Python 3.5.x or higher is now required if running on a python 3 version
    * Removed the monkeypatching of RedisCluster, ClusterPubSub & ClusterPipeline class names into the "redis" python package namespace during runtime.
      They are now exposed in the "rediscluster" namespace to mimic the same feature from redis-py
    * cluster_down_retry_attempts can now be configured to any value when creating RedisCluster instance
    * Creating RedisCluster from unix socket url:s has been disabled
    * Patch the from_url method to use the corret cluster version of the same Connection class
    * ConnectionError and TimeoutError is now handled seperately in the main execute loop to better handle each case (#363)
    * Update scan_iter custom cluster implementation
    * Improve description_format handling for connection classes to simplify how they work
    * Implement new connection pool ClusterBlockingConnectionPool (#347)
    * Nodemanager initiailize should now handle usernames properly (#365)
    * PubSub tests has been all been disabled
    * New feature, host_port_remap. Send in a remapping configuration to RedisCluster instance where the nodes configuration recieved from the redis cluster can be altered to allow for connection in certain circumstances. See new section in client.rst in docs/ for usage example.
    * When a slot is not covered by the cluster, it will not raise SlotNotCoveredError instead of the old generic RedisClusterException. The client will not attempt to rebuild the cluster layout a few times before giving up and raising that exception to the user. (#350)
    * CLIENT SETNAME is now possible to use from the client instance. For setting the name for all connections from the client by default, see issue #802 in redis-py repo for the change that was implemented in redis-py 3.4.0.
    * Rewrote implemented commands documentation to mimic the redis.io commands documentation and describe each command and any additional implementation that has been made.
    * Added RTD theme to the rendered output when running the documentation in local dev mode. 
    * Added some basic logging to the client that should make it easier to debug and track down minor issues around the main execution loop. See docs/logging.rst for implementation example into your own code.
    * Seperated some of the exception handling inside the main execution loop to get more fine grained controll what to do at certain errors.
    
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-2.1.0.tar.gz(39.55 KB)
    redis_py_cluster-2.1.0-py2.py3-none-any.whl(40.57 KB)
  • 2.0.99(May 22, 2020)

    • This is a release candidate for 2.1.0 release.
    • This release will be built from commit 2605ed0adf58c4540dda0d9121a9767238be76e8 from the master branch.
    • The version number will be set to 2.0.99 to allow for upgrade but not to collide with 2.1.0 release.
    • This release will NOT be uploaded to pypi. It is only accessible here.
    • This RC release will be out for about 1 week and then a proper release will be cut and pushed.
    • All changes and commits can be inspected here https://github.com/Grokzen/redis-py-cluster/compare/2.0.0...master

    Release notes for release

    2.1.0 (May **, 2020)

    * Add new config option for Client and Pipeline classes to controll how many attempts will be made before bailing out from a ClusterDownError.
      Use "cluster_down_retry_attempts=<int>" when creating the client class to controll this behaviour.
    * Updated redis-py compatbile version to support any version in the major version 3.0.x, 3.1.x, 3.2.x, 3.3.x., 3.4.x, 3.5.x (#326)
      It is always recommended to use the latest version of redis-py to avoid issues and compatiblity problems.
    * Fixed bug preventing reinitialization after getting MOVED errors
    * Add testing of redis-esrver 6.0 versions to travis and unit tests
    * Add python 2.7 compatiblity note about deprecation and upcomming changes in python 2.7 support for this lib
    * Updated tests and cluster tests versions of the same methods to latest tests from upstream redis-py package
    * Reorganized tests and how cluster specific tests is written and run over the upstream version of the same test to make it easier
      and much faster to update and keep them in sync over time going into the future (#368)
    * Python 3.5.x or higher is now required if running on a python 3 version
    * Removed the monkeypatching of RedisCluster, ClusterPubSub & ClusterPipeline class names into the "redis" python package namespace during runtime.
      They are now exposed in the "rediscluster" namespace to mimic the same feature from redis-py
    * cluster_down_retry_attempts can now be configured to any value when creating RedisCluster instance
    * Creating RedisCluster from unix socket url:s has been disabled
    * Patch the from_url method to use the corret cluster version of the same Connection class
    * ConnectionError and TimeoutError is now handled seperately in the main execute loop to better handle each case (#363)
    * Update scan_iter custom cluster implementation
    * Improve description_format handling for connection classes to simplify how they work
    * Implement new connection pool ClusterBlockingConnectionPool (#347)
    * Nodemanager initiailize should now handle usernames properly (#365)
    * PubSub tests has been all been disabled
    * New feature, host_port_remap. Send in a remapping configuration to RedisCluster instance where the nodes configuration recieved from the redis cluster can be altered to allow for connection in certain circumstances. See new section in clients.rst in docs/ for usage example.
    * When a slot is not covered by the cluster, it will not raise SlotNotCoveredError instead of the old generic RedisClusterException. The client will not attempt to rebuild the cluster layout a few times before giving up and raising that exception to the user. (#350)
    * CLIENT SETNAME is now possible to use from the client instance. For setting the name for all connections from the client by default, see issue #802 in redis-py repo for the change that was implemented in redis-py 3.4.0.
    
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-2.0.99.tar.gz(37.34 KB)
    redis_py_cluster-2.0.99-py2.py3-none-any.whl(39.03 KB)
  • 2.0.0(Aug 19, 2019)

    2.0.0 (Aug 19, 2019)

    • Update entire code base to now support all redis-py version in the 3.0.x version line. Any future redis-py version will be supported at a later time.
    • Major update to all tests to mirror the code of the same tests from redis-py
    • Dropped support for the 2.10.6 redis-py release.
    • Add pythoncodestyle lint validation check to travis-ci runs to check for proper linting before accepting PR:s
    • Class StrictRedisCluster was renamed to RedisCluster
    • Class StrictRedis has been removed to mirror upstream class structure
    • Class StrictClusterPipeline was renamed to ClusterPipeline
    • Fixed travis-ci tests not running properly on python 3.7
    • Fixed documentation regarding threads in pipelines
    • Update lit of command callbacks and parsers. Added in "CLIENT ID"
    • Removed custom implementation of SORT and revert back to use same-slot mechanism for that command.
    • Added better exception message to get_master_node_by_slot command to help the user understand the error.
    • Improved the exception object message parsing when running on python3
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-2.0.0.tar.gz(33.46 KB)
    redis_py_cluster-2.0.0-py2.py3-none-any.whl(34.12 KB)
  • 1.3.6(Nov 16, 2018)

  • 1.3.5(Jul 22, 2018)

    • Add Redis 4 compatability fix to CLUSTER NODES command (See issue #217)
    • Fixed bug with command "CLUSTER GETKEYSINSLOT" that was throwing exceptions
    • Added new methods cluster_get_keys_in_slot() to client
    • Fixed bug with StrictRedisCluster.from_url that was ignoring the readonly_mode parameter
    • NodeManager will now ignore nodes showing cluster errors when initializing the cluster
    • Fix bug where RedisCluster wouldn't refresh the cluster table when executing commands on specific nodes
    • Add redis 5.0 to travis-ci tests
    • Change default redis version from 3.0.7 to 4.0.10
    • Increase accepted ranges of dependencies specefied in dev-requirements.txt
    • Several major and minor documentation updates and tweaks
    • Add example script "from_url_password_protected.py"
    • command "CLUSTER GETKEYSINSLOT" is now returned as a list and not int
    • Improve support for ssl connections
    • Retry on Timeout errors when doing cluster discovery
    • Added new error class "MasterDownError"
    • Updated requirements for dependency of redis-py to latest version
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-1.3.5.tar.gz(33.05 KB)
  • 1.3.4(Mar 5, 2017)

    • Package is now built as a wheel and source package when releases is built.
    • Fixed issues with some key types in NodeManager.keyslot().
    • Add support for PUBSUB subcommands CHANNELS, NUMSUB [arg] [args...] and NUMPAT.
    • Add method set_result_callback(command, callback) allowing the default reply callbacks to be changed, in the same way set_response_callback(command, callback) inherited from Redis-Py does for responses.
    • Node manager now honors defined max_connections variable so connections that is emited from that class uses the same variable.
    • Fixed a bug in cluster detection when running on python 3.x and decode_responses=False was used. Data back from redis for cluster structure is now converted no matter what the data you want to set/get later is using.
    • Add SSLClusterConnection for connecting over TLS/SSL to Redis Cluster
    • Add new option to make the nodemanager to follow the cluster when nodes move around by avoiding to query the original list of startup nodes that was provided when the client object was first created. This could make the client handle drifting clusters on for example AWS easier but there is a higher risk of the client talking to the wrong group of nodes during split-brain event if the cluster is not consistent. This feature is EXPERIMENTAL and use it with care.
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-1.3.4.tar.gz(32.04 KB)
    redis_py_cluster-1.3.4-py2.py3-none-any.whl(39.02 KB)
  • 1.3.3(Dec 15, 2016)

  • 1.3.2(Nov 27, 2016)

    • Fix a bug where from_url was not possible to use without passing in additional variables. Now it works as the same method from redis-py. Note that the same rules that is currently in place for passing ip addresses/dns names into startup_nodes variable apply the same way through the from_url method.
    • Added options to skip full coverage check. This flag is useful when the CONFIG redis command is disabled by the server.
    • Fixed a bug where method CLUSTER SLOTS would break in newer redis versions where node id is included in the reponse. Method is not compatible with both old and new redis versions.
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-1.3.2.tar.gz(30.29 KB)
  • 1.3.1(Oct 13, 2016)

    • Rebuilt broken method scan_iter. Previous tests was to small to detect the problem but is not corrected to work on a bigger dataset during the test of that method. (korvus81, Grokzen,
    • Errors in pipeline that should be retried, like connection errors, moved, errors and ask errors now fall back to single operation logic in StrictRedisCluster.execute_command. (72squared).
    • Moved reinitialize_steps and counter into nodemanager so it can be correctly counted across pipeline operations (72squared).
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-1.3.1.tar.gz(29.22 KB)
  • 1.3.0(Sep 11, 2016)

    • Removed RedisClusterMgt class and file
    • Fixed a bug when using pipelines with RedisCluster class (Ozahata)
    • Bump redis-server during travis tests to 3.0.7
    • Added docs about same module name in another python redis cluster project.
    • Fix a bug when a connection was to be tracked for a node but the node either do not yet exists or was removed because of resharding was done in another thread. (ashishbaghudana)
      • Fixed a bug with "CLUSTER ..." commands when a node_id argument was needed and the return type was supposed to be converted to bool with bool_ok in redis._compat.
    • Add back gitter chat room link
    • Add new client commands
      • cluster_reset_all_nodes
    • Command cluster_delslots now determines what cluster shard each slot is on and sends each slot deletion command to the correct node. Command have changed argument spec (Read Upgrading.rst for details)
    • Fixed a bug when hashing the key it if was a python 3 byte string and it would cause it to route to wrong slot in the cluster (fossilet, Grokzen)
    • Fixed a bug when reinitialize the nodemanager it would use the old nodes_cache instead of the new one that was just parsed (monklof)
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-1.3.0.tar.gz(28.72 KB)
  • 1.2.0(Apr 9, 2016)

    • Drop maintained support for python 3.2.
    • Remove Vagrant file in favor for repo maintained by 72squared
    • Add Support for password protected cluster (etng)
    • Removed assertion from code (gmolight)
    • Fixed a bug where a regular connection pool was allocated with each StrictRedisCluster instance.
    • Rework pfcount to now work as expected when all arguments points to same hashslot
    • New code and important changes from redis-py 2.10.5 have been added to the codebase.
    • Removed the need for threads inside of pipeline. We write the packed commands all nodes before reading the responses which gives us even better performance than threads, especially as we add more nodes to the cluster.
    • Allow passing in a custom connection pool
    • Provide default max_connections value for ClusterConnectionPool (2__31)
    • Travis now tests both redis 3.0.x and 3.2.x
    • Add simple ptpdb debug script to make it easier to test the client
    • Fix a bug in sdiffstore (mt3925)
    • Fix a bug with scan_iter where duplicate keys would be returned during itteration
    • Implement all "CLUSTER ..." commands as methods in the client class
    • Client now follows the service side setting 'cluster-require-full-coverage=yes/no' (baranbartu)
    • Change the pubsub implementation (PUBLISH/SUBSCRIBE commands) from using one single node to now determine the hashslot for the channel name and use that to connect to a node in the cluster. Other clients that do not use this pattern will not be fully compatible with this client. Known limitations is pattern subscription that do not work properly because a pattern can't know all the possible channel names in advance.
    • Convert all docs to ReadTheDocs
    • Rework connection pool logic to be more similar to redis-py. This also fixes an issue with pubsub and that connections was never release back to the pool of available connections.
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-1.2.0.tar.gz(28.75 KB)
  • 1.1.0(Oct 27, 2015)

    • Refactored exception handling and exception classes.
    • Added READONLY mode support, scales reads using slave nodes.
    • Fix repr for ClusterConnectionPool and ClusterReadOnlyConnectionPool
    • Add max_connections_per_node parameter to ClusterConnectionPool so that max_connections parameter is calculated per-node rather than across the whole cluster.
    • Improve thread safty of get_connection_by_slot and get_connection_by_node methods (iandyh)
    • Improved error handling when sending commands to all nodes, e.g. info. Now the connection takes retry_on_timeout as an option and retry once when there is a timeout. (iandyh)
    • Added support for SCRIPT LOAD, SCRIPT FLUSH, SCRIPT EXISTS and EVALSHA commands. (alisaifee)
    • Improve thread safety to avoid exceptions when running one client object inside multiple threads and doing resharding of the cluster at the same time.
    • Fix ASKING error handling so now it really sends ASKING to next node during a reshard operation. This improvement was also made to pipelined commands.
    • Improved thread safety in pipelined commands, along better explanation of the logic inside pipelining with code comments.
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-1.1.0.tar.gz(28.82 KB)
  • 1.0.0(Jun 10, 2015)

  • 0.3.0(Jun 9, 2015)

    * simple benchmark now uses docopt for cli parsing
    * New make target to run some benchmarks 'make benchmark'
    * simple benchmark now support pipelines tests
    * Renamed RedisCluster --> StrictRedisCluster
    * Implement backwards compatible redis.Redis class in cluster mode. It was named RedisCluster and everyone updating from 0.2.0 to 0.3.0 should consult docs/Upgrading.md for instructions how to change your code.
    * Added comprehensive documentation regarding pipelines
    * Meta retrieval commands(slots, nodes, info) for Redis Cluster. (iandyh)
    
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-0.3.0.tar.gz(24.12 KB)
  • 0.2.0(Dec 26, 2014)

    * Moved pipeline code into new file.
    * Code now uses a proper cluster connection pool class that handles 
      all nodes and connections similar to how redis-py do.
    * Better support for pubsub. All clients will now talk to the same server because 
      pubsub commands do not work reliably if it talks to a random server in the cluster.
    * Better result callbacks and node routing support. No more ugly decorators.
    * Fix keyslot command when using non ascii characters.
    * Add bitpos support, redis-py 2.10.2 or higher required.
    * Fixed a bug where vagrant users could not build the package via shared folder.
    * Better support for CLUSTERDOWN error. (Neuront)
    * Parallel pipeline execution using threads. (72squared)
    * Added vagrant support for testing and development. (72squared)
    * Improve stability of client during resharding operations (72squared)
    
    Source code(tar.gz)
    Source code(zip)
    redis-py-cluster-0.2.0.tar.gz(21.02 KB)
  • 0.1.0-stable(Dec 26, 2014)

Redis client for Python asyncio (PEP 3156)

Redis client for Python asyncio. Redis client for the PEP 3156 Python event loop. This Redis library is a completely asynchronous, non-blocking client

Jonathan Slenders 554 Dec 4, 2022
Official Python low-level client for Elasticsearch

Python Elasticsearch Client Official low-level client for Elasticsearch. Its goal is to provide common ground for all Elasticsearch-related code in Py

elastic 3.8k Jan 1, 2023
A tiny python web application based on Flask to set, get, expire, delete keys of Redis database easily with direct link at the browser.

First Redis Python (CRUD) A tiny python web application based on Flask to set, get, expire, delete keys of Redis database easily with direct link at t

Max Base 9 Dec 24, 2022
An asyncio compatible Redis driver, written purely in Python. This is really just a pet-project for me.

asyncredis An asyncio compatible Redis driver. Just a pet-project. Information asyncredis is, like I've said above, just a pet-project for me. I reall

Vish M 1 Dec 25, 2021
asyncio (PEP 3156) Redis support

aioredis asyncio (PEP 3156) Redis client library. Features hiredis parser Yes Pure-python parser Yes Low-level & High-level APIs Yes Connections Pool

aio-libs 2.2k Jan 4, 2023
Pure Python MySQL Client

PyMySQL Table of Contents Requirements Installation Documentation Example Resources License This package contains a pure-Python MySQL client library,

PyMySQL 7.2k Jan 9, 2023
Python client for Apache Kafka

Kafka Python client Python client for the Apache Kafka distributed stream processing system. kafka-python is designed to function much like the offici

Dana Powers 5.1k Jan 8, 2023
A fast PostgreSQL Database Client Library for Python/asyncio.

asyncpg -- A fast PostgreSQL Database Client Library for Python/asyncio asyncpg is a database interface library designed specifically for PostgreSQL a

magicstack 5.8k Dec 31, 2022
Asynchronous Python client for InfluxDB

aioinflux Asynchronous Python client for InfluxDB. Built on top of aiohttp and asyncio. Aioinflux is an alternative to the official InfluxDB Python cl

Gustavo Bezerra 159 Dec 27, 2022
Google Cloud Client Library for Python

Google Cloud Python Client Python idiomatic clients for Google Cloud Platform services. Stability levels The development status classifier on PyPI ind

Google APIs 4.1k Jan 1, 2023
python-bigquery Apache-2python-bigquery (🥈34 · ⭐ 3.5K · 📈) - Google BigQuery API client library. Apache-2

Python Client for Google BigQuery Querying massive datasets can be time consuming and expensive without the right hardware and infrastructure. Google

Google APIs 550 Jan 1, 2023
High level Python client for Elasticsearch

Elasticsearch DSL Elasticsearch DSL is a high-level library whose aim is to help with writing and running queries against Elasticsearch. It is built o

elastic 3.6k Jan 3, 2023
Python client for InfluxDB

InfluxDB-Python InfluxDB-Python is a client for interacting with InfluxDB. Development of this library is maintained by: Github ID URL @aviau (https:/

InfluxData 1.6k Dec 24, 2022
Confluent's Kafka Python Client

Confluent's Python Client for Apache KafkaTM confluent-kafka-python provides a high-level Producer, Consumer and AdminClient compatible with all Apach

Confluent Inc. 3.1k Jan 5, 2023
MinIO Client SDK for Python

MinIO Python SDK for Amazon S3 Compatible Cloud Storage MinIO Python SDK is Simple Storage Service (aka S3) client to perform bucket and object operat

High Performance, Kubernetes Native Object Storage 582 Dec 28, 2022
Pysolr — Python Solr client

pysolr pysolr is a lightweight Python client for Apache Solr. It provides an interface that queries the server and returns results based on the query.

Haystack Search 626 Dec 1, 2022
PyRemoteSQL is a python SQL client that allows you to connect to your remote server with phpMyAdmin installed.

PyRemoteSQL Python MySQL remote client Basically this is a python SQL client that allows you to connect to your remote server with phpMyAdmin installe

ProbablyX 3 Nov 4, 2022
Py2neo is a client library and toolkit for working with Neo4j from within Python

Py2neo Py2neo is a client library and toolkit for working with Neo4j from within Python applications. The library supports both Bolt and HTTP and prov

py2neo.org 1.2k Jan 2, 2023
Python version of the TerminusDB client - for TerminusDB API and WOQLpy

TerminusDB Client Python Development status ⚙️ Python Package status ?? Python version of the TerminusDB client - for TerminusDB API and WOQLpy Requir

TerminusDB 66 Dec 2, 2022