RedisGears Python Client
Project description
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 git+https://github.com/RedisGears/redisgears-py.git
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gearsclient-1.0.2.tar.gz
(5.2 kB
view details)
Built Distribution
File details
Details for the file gearsclient-1.0.2.tar.gz
.
File metadata
- Download URL: gearsclient-1.0.2.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.7.12 Linux/5.11.0-1020-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1267d3882389ec23e8f3b48447dab262fb35e10bd2e576da511ba8a4b517799 |
|
MD5 | be6b4afb287f36881ff0bfedc565a873 |
|
BLAKE2b-256 | 20b8f1d4be12e2d6d97c28033a181fdbfade412874f383628659c7e81bef1787 |
File details
Details for the file gearsclient-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: gearsclient-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.7.12 Linux/5.11.0-1020-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac0ee20d1e27375a1fffec05f9112577d15569808707151574db86d8d2228f57 |
|
MD5 | cd109ba09e87b26b4f7ba4d21628a6e0 |
|
BLAKE2b-256 | d9ff48ffd9f410efc62c85edc0c9017f4e505d067c340e6d7982a79336fda7f8 |