Skip to main content

RedisGears Python Client

Project description

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 pyredisgears

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyredisgears-2.0.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyredisgears-2.0.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file pyredisgears-2.0.1.tar.gz.

File metadata

  • Download URL: pyredisgears-2.0.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.8 Darwin/24.2.0

File hashes

Hashes for pyredisgears-2.0.1.tar.gz
Algorithm Hash digest
SHA256 b38ae917343c6d90bb030edc3f4bbde8d1a4b933077100f73fec2fe19db0d3f0
MD5 9bda628e417dabaf9463ccee11ee4d95
BLAKE2b-256 1e5c6ed95f970e392e9fea5d58a6f91cb15f9a372a63cb86b44ca07fb53a6e38

See more details on using hashes here.

File details

Details for the file pyredisgears-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyredisgears-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.8 Darwin/24.2.0

File hashes

Hashes for pyredisgears-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e6b493195908f9468cc93701db23648c928fd8112ec01743002d35ba63d8ecf4
MD5 5c80b98dfc1ed78f066e0b1d312861da
BLAKE2b-256 79a9a4f37e1c8d51b296b508af4d59f78fa8edb77748fd338b8a3bcf7d1998ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page