Skip to main content
https://img.shields.io/pypi/v/rediswrapper.svg https://img.shields.io/pypi/pyversions/rediswrapper.svg https://github.com/frostming/rediswrapper/actions/workflows/ci.yml/badge.svg

rediswrapper is a pythonic wrapper of Redis Client for end users. The whole storage acts like a python dict as well as its child storage values.

Features

  • The root client support dict-like operations

  • Python object wrappers for list, set, hash type values

  • Implicit serialization and deserialization when storing and fetching data

Installation

From PyPI:

pip install rediswrapper

From GitHub:

git clone https://github.com/frostming/rediswrapper
cd rediswrapper
pip install .

Usage

rediswrapper will try to serialize non-sting values and store them in redis and deserialize them when fetching back.

All redis value types are mocked with respective python objects and support all standard methods as the builtin types.

>>> import rediswrapper
>>> redis = rediswrapper.RedisDict()
# String value
>>> redis['a'] = 'hello'
# int value
>>> redis['b'] = 2
>>> dict(redis)
{'a': 'hello', 'b': 2}
# Picklable object
>>> import datetime
>>> redis['c'] = datetime.datetime.now()
# List value
>>> redis['d'] = list(range(5))
>>> redis['d'].append(0)
>>> redis['d']
ListType value([0, 1, 2, 3, 4, 0])
# Hash value
>>> redis['e'] = {'a': 1, 'b': 2}
>>> redis['e'].get('a')
1
# Set value
>>> redis['f'] = set([1, 2])
>>> redis['f'].add(3)
>>> redis['f']
SetType value([1, 2, 3])

To inspect those value types, one should use the ABCs defined in collections module.

>>> from collections import Mapping
>>> isinstance(redis['e'], Mapping)
True

History

v0.4.0
  • Drop support for Python older than 3.6

v0.3.0
  • Drop support for Python 3.3

  • Fix a vulnerability issue that cause users run arbitrary scripts.

Licensing

This work is open-sourced under the MIT license.

Release files for rediswrapper 0.4.0.post1

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

Source distribution (sdist)

Source distribution for rediswrapper 0.4.0.post1
File Size Uploaded
rediswrapper-0.4.0.post1.tar.gz 4.8 kB Details

Built distribution (wheel)

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

Total release size: 10.6 kB

Release files / rediswrapper-0.4.0.post1.tar.gz

Download URL rediswrapper-0.4.0.post1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
de1920cfaacb4c6d5b7fb57409aa49b2a68cc23b773277bda952a5f19b7e7163
BLAKE2b-256 checksum
How to use checksums
9cfbb38f2699c95f206948e53aacb061e62212767b607baa4324c70839596fb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.3.4 CPython/3.10.4

Release files / rediswrapper-0.4.0.post1-py3-none-any.whl

Download URL rediswrapper-0.4.0.post1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3169528602ee2ca0f504876e5ad10ae36dd9077b67673480f49551e3cb281808
BLAKE2b-256 checksum
How to use checksums
803cf8304fb2a82bd1d28d87a2895c96c9b3454f18ae33baf620834835298891
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.3.4 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.4.0.post1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

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