Skip to main content

gxredis

Simple redis-py wrapper library

Installation

To install gxredis, simply:

$ sudo pip install gxredis

Usage

>>> import redis
>>> from gxredis import *

>>> class ItemDao(RedisDao):
>>>        item = RedisString("device:{device_id}:item:{item_id}")
>>>        item_list = RedisList("device:{device_id}:list")
>>>        item_set = RedisSet("device:{device_id}:set")
>>>        item_hash = RedisHash("device:{device_id}:hash")
>>>        item_zset = RedisSortedSet("device:{device_id}:zset")

>>> client = redis.StrictRedis("localhost", 6379, 15)
>>> dao = ItemDao(client, key_params={"device_id": "GX123"})

>>> dao.item
RedisString(key="device:{device_id}:item:{item_id}", key_params={'device_id': 'GX123'})

>>> dao.item_list
RedisList(key="device:{device_id}:list", key_params={'device_id': 'GX123'})

>>> dao.item(item_id=1).set("item01")
True

>>> dao.item(item_id=1).get()
'item01'

>>> pipe = dao.pipeline()
>>> accr1 = pipe.item(item_id=1)     # accessor for item01
>>> accr2 = pipe.item(item_id=2)     # accessor for item02
>>> accr1.set("item01")
>>> accr2.set("item02")
>>> pipe.item_list.rpush(accr1.key)
>>> pipe.item_list.rpush(accr2.key)
>>> pipe.execute()

>>> dao.item_list.lrange(0, 100)
['device:GX123:item:1', 'device:GX123:item:2']

LICENSE

  • MIT

Metadata

Release files for gxredis 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gxredis 0.3.2
File Size Uploaded Provenance
gxredis-0.3.2.tar.gz 6.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gxredis 0.3.2
File Interpreter ABI Platform
gxredis-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.4 kB

Release files / gxredis-0.3.2.tar.gz

Download URL gxredis-0.3.2.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ea3f686a22e9371a2103bef202d4513c388ac36d0df5d0212ffc218c41532502
BLAKE2b-256 checksum
How to use checksums
ab6d9583913fa43ff5de52bf8c0417f96e4db0c68cffbed4465276557f6962b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

Release files / gxredis-0.3.2-py3-none-any.whl

Download URL gxredis-0.3.2-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32dc38cf9a3065e3d3b75f0cd1ca1fea083a554a119c3bc716b33aa54d33ae64
BLAKE2b-256 checksum
How to use checksums
91ba0aa30938d3d140600b7c07486ea3e73e08841a782d4450ad5067b092d75d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

Security for gxredis 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page