redisgears-py
RedisGears python client (support python3 only!)
Example: Using the Python Client:
from gearsclient import GearsRemoteBuilder as GearsBuilder
from gearsclient import execute
import redis
conn = redis.Redis(host='localhost', port=6379)
# count for each genre how many times it appears
res = GearsBuilder('KeysOnlyReader', r=conn).\
map(lambda x:execute('hget', x, 'genres')).\
filter(lambda x:x != '\\N').\
flatmap(lambda x: x.split(',')).\
map(lambda x: x.strip()).\
countby().\
run()
for r in res[0]:
print('%-15s: %d' % (r['key'], r['value']))
Installing
pip install pyredisgears
Notice that the library also need to be installed in RedisGears virtual env.
Developing
- Create a virtualenv to manage your python dependencies, and ensure it's active.
virtualenv -v venv - Install pypoetry to manage your dependencies.
pip install poetry - Install dependencies.
poetry install
tox runs all tests as its default target. Running tox by itself will run unit tests. Ensure you have a running redis, with the module loaded.
Metadata
Release files for pyredisgears 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyredisgears-2.0.1.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyredisgears-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.8 kB
Release files / pyredisgears-2.0.1.tar.gz
| Download URL | pyredisgears-2.0.1.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b38ae917343c6d90bb030edc3f4bbde8d1a4b933077100f73fec2fe19db0d3f0
|
|
BLAKE2b-256 checksum How to use checksums |
1e5c6ed95f970e392e9fea5d58a6f91cb15f9a372a63cb86b44ca07fb53a6e38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.8 Darwin/24.2.0
|
Release files / pyredisgears-2.0.1-py3-none-any.whl
| Download URL | pyredisgears-2.0.1-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6b493195908f9468cc93701db23648c928fd8112ec01743002d35ba63d8ecf4
|
|
BLAKE2b-256 checksum How to use checksums |
79a9a4f37e1c8d51b296b508af4d59f78fa8edb77748fd338b8a3bcf7d1998ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.8 Darwin/24.2.0
|