Name | rediswrapper JSON |
Version |
0.4.0.post1
JSON |
| download |
home_page | |
Summary | Pythonic wrapper for Redis Client. |
upload_time | 2023-01-09 01:55:09 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.6 |
license | MIT |
keywords |
redis
client
mock
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
Redis Wrapper
=============
.. image:: https://img.shields.io/pypi/v/rediswrapper.svg
:target: https://pypi.org/project/rediswrapper
.. image:: https://img.shields.io/pypi/pyversions/rediswrapper.svg
:target: https://pypi.org/project/rediswrapper
.. image:: https://github.com/frostming/rediswrapper/actions/workflows/ci.yml/badge.svg
:target: https://github.com/frostming/rediswrapper/actions/workflows/ci.yml
*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.
.. code:: python
>>> 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.
.. code:: python
>>> 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>`_ license.
Raw data
{
"_id": null,
"home_page": "",
"name": "rediswrapper",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "redis,client,mock",
"author": "",
"author_email": "Frost Ming <mianghong@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/9c/fb/b38f2699c95f206948e53aacb061e62212767b607baa4324c70839596fb4/rediswrapper-0.4.0.post1.tar.gz",
"platform": null,
"description": "Redis Wrapper\n=============\n.. image:: https://img.shields.io/pypi/v/rediswrapper.svg\n :target: https://pypi.org/project/rediswrapper\n.. image:: https://img.shields.io/pypi/pyversions/rediswrapper.svg\n :target: https://pypi.org/project/rediswrapper\n.. image:: https://github.com/frostming/rediswrapper/actions/workflows/ci.yml/badge.svg\n :target: https://github.com/frostming/rediswrapper/actions/workflows/ci.yml\n\n*rediswrapper is a pythonic wrapper of Redis Client for end users. The whole storage\nacts like a python dict as well as its child storage values.*\n\nFeatures\n--------\n* The root client support dict-like operations\n* Python object wrappers for list, set, hash type values\n* Implicit serialization and deserialization when storing and fetching data\n\nInstallation\n------------\nFrom PyPI::\n\n pip install rediswrapper\n\nFrom GitHub::\n\n git clone https://github.com/frostming/rediswrapper\n cd rediswrapper\n pip install .\n\n\nUsage\n-----\n\n``rediswrapper`` will try to serialize non-sting values and store them in redis and\ndeserialize them when fetching back.\n\nAll redis value types are mocked with respective python objects and support all\nstandard methods as the builtin types.\n\n.. code:: python\n\n >>> import rediswrapper\n >>> redis = rediswrapper.RedisDict()\n # String value\n >>> redis['a'] = 'hello'\n # int value\n >>> redis['b'] = 2\n >>> dict(redis)\n {'a': 'hello', 'b': 2}\n # Picklable object\n >>> import datetime\n >>> redis['c'] = datetime.datetime.now()\n # List value\n >>> redis['d'] = list(range(5))\n >>> redis['d'].append(0)\n >>> redis['d']\n ListType value([0, 1, 2, 3, 4, 0])\n # Hash value\n >>> redis['e'] = {'a': 1, 'b': 2}\n >>> redis['e'].get('a')\n 1\n # Set value\n >>> redis['f'] = set([1, 2])\n >>> redis['f'].add(3)\n >>> redis['f']\n SetType value([1, 2, 3])\n\nTo inspect those value types, one should use the ABCs defined in ``collections``\nmodule.\n\n.. code:: python\n\n >>> from collections import Mapping\n >>> isinstance(redis['e'], Mapping)\n True\n\nHistory\n-------\n\nv0.4.0\n * Drop support for Python older than 3.6\n\nv0.3.0\n * Drop support for Python 3.3\n * Fix a vulnerability issue that cause users run arbitrary scripts.\n\nLicensing\n---------\nThis work is open-sourced under the `MIT <LICENSE>`_ license.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Pythonic wrapper for Redis Client.",
"version": "0.4.0.post1",
"split_keywords": [
"redis",
"client",
"mock"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "803cf8304fb2a82bd1d28d87a2895c96c9b3454f18ae33baf620834835298891",
"md5": "e5c245dbe2f12b7ccc0855dcdb0cf422",
"sha256": "3169528602ee2ca0f504876e5ad10ae36dd9077b67673480f49551e3cb281808"
},
"downloads": -1,
"filename": "rediswrapper-0.4.0.post1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e5c245dbe2f12b7ccc0855dcdb0cf422",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 5748,
"upload_time": "2023-01-09T01:55:07",
"upload_time_iso_8601": "2023-01-09T01:55:07.571910Z",
"url": "https://files.pythonhosted.org/packages/80/3c/f8304fb2a82bd1d28d87a2895c96c9b3454f18ae33baf620834835298891/rediswrapper-0.4.0.post1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9cfbb38f2699c95f206948e53aacb061e62212767b607baa4324c70839596fb4",
"md5": "e9d1ed229a997c6a9c2d03b701df1109",
"sha256": "de1920cfaacb4c6d5b7fb57409aa49b2a68cc23b773277bda952a5f19b7e7163"
},
"downloads": -1,
"filename": "rediswrapper-0.4.0.post1.tar.gz",
"has_sig": false,
"md5_digest": "e9d1ed229a997c6a9c2d03b701df1109",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 4811,
"upload_time": "2023-01-09T01:55:09",
"upload_time_iso_8601": "2023-01-09T01:55:09.181655Z",
"url": "https://files.pythonhosted.org/packages/9c/fb/b38f2699c95f206948e53aacb061e62212767b607baa4324c70839596fb4/rediswrapper-0.4.0.post1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-09 01:55:09",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "rediswrapper"
}