RedisGears / redisgears-py

RedisGears python client

Home Page:https://redisgears.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

license PyPI version CircleCI GitHub issues Codecov Known Vulnerabilities

redisgears-py

Forum Discord

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 git+https://github.com/RedisGears/redisgears-py.git

Notice that the library also need to be installed in RedisGears virtual env.

Developing

  1. Create a virtualenv to manage your python dependencies, and ensure it's active. virtualenv -v venv
  2. Install pypoetry to manage your dependencies. pip install poetry
  3. 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.

About

RedisGears python client

https://redisgears.io/

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%