RedisGears Python Client
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: print('%-15s: %d' % (r['key'], r['value']))
pip install git+https://github.com/RedisGears/redisgears-py.git
Notice that the library also need to be installed in RedisGears virtual env.
- 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.
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.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for gearsclient-1.0.2-py3-none-any.whl