python-redis
Port variant py39
Summary Redis database and key-value store client (3.9)
Package version 4.1.4
Homepage https://github.com/redis/redis-py
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants py310
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 22 FEB 2022, 02:10:24 UTC
Port created 28 AUG 2018, 14:25:25 UTC
Subpackage Descriptions
single # redis-py The Python interface to the Redis key-value store. [CI] [docs] [MIT licensed] [pypi] [codecov] [Total alerts] [Installation] | [Contributing] | [Getting Started] | [Connecting To Redis] --------------------------------------------- ## Installation redis-py requires a running Redis server. See [Redis's quickstart] for installation instructions. redis-py can be installed using pip similar to other Python packages. Do not use sudo with pip. It is usually good to work in a [virtualenv] or [venv] to avoid conflicts with other package managers and Python projects. For a quick introduction see [Python Virtual Environments in Five Minutes]. To install redis-py, simply: ``` bash $ pip install redis ``` or from source: ``` bash $ python setup.py install ``` View the current documentation [here]. ## Contributing Want to contribute a feature, bug fix, or report an issue? Check out our [guide to contributing]. ## Getting Started redis-py supports Python 3.6+. ``` pycon >>> import redis >>> r = redis.Redis(host='localhost', port=6379, db=0) >>> r.set('foo', 'bar') True >>> r.get('foo') b'bar' ``` By default, all responses are returned as bytes in Python 3. If **all** string responses from a client should be decoded, the user can specify *decode_responses=True* in ```Redis.__init__```. In this case, any Redis command that returns a string type will be decoded with the encoding specified. The default encoding is utf-8, but this can be customized by specifiying the encoding argument for the redis.Redis class. The encoding will be used to automatically encode any strings passed to commands, such as key names and values. -------------------- ### MSET, MSETNX and ZADD These commands all accept a mapping of key/value pairs. In redis-py 2.X this mapping could be specified as **args* or as `**kwargs`. Both of these styles caused issues when Redis introduced optional flags to ZADD. Relying on `*args` caused issues with the optional argument order, especially in Python 2.7. Relying on `**kwargs` caused potential collision issues of user keys with the argument names in the method signature. To resolve this, redis-py 3.0 has changed these three commands to all accept a single positional argument named mapping that is expected to be a dict. For MSET and MSETNX, the dict is a mapping of key-names -\> values. For ZADD, the dict is a mapping of element-names -\> score. MSET, MSETNX and ZADD now look like: ``` pycon def mset(self, mapping):
Configuration Switches (platform-specific settings discarded)
PY310 OFF Build using Python 3.10 PY39 ON Build using Python 3.9
Package Dependencies by Type
Build (only) python-pip:single:py39
autoselect-python:single:standard
Build and Runtime python39:single:standard
Runtime (only) python-Deprecated:single:py39
python-packaging:single:py39
Download groups
main mirror://PYPIWHL/c5/fa/730caa74a6d6d88c289176161b2f56cac27f108cf3102165343dbaf1bc84
Distribution File Information
04629f8e42be942c4f7d1812f2094568f04c612865ad19ad3ace3005da70631a 175837 redis-4.1.4-py3-none-any.whl
Ports that require python-redis:py39
No other ports depend on this one.