Wechat Storage Module for Python.
Project description
Wechat Storage Module for Python.
Installation
pip install pywe-storage
Usage
MemoryStorage:
In [1]: from pywe_storage import MemoryStorage In [2]: storage = MemoryStorage() In [3]: storage.set('xx:oo', {'a': 1, 'b': 2}) In [4]: storage.get('xx:oo') Out[4]: {'a': 1, 'b': 2}
RedisStorage:
In [1]: import redis_extensions as redis In [2]: r = redis.StrictRedisExtensions(host='localhost', port=6379, db=0) In [3]: from pywe_storage import RedisStorage In [4]: storage = RedisStorage(r) In [5]: storage.set('xx:oo', {'a': 1, 'b': 2}) In [6]: storage.get('xx:oo') Out[6]: {u'a': 1, u'b': 2} In [7]: r.get('pywe:xx:oo') Out[7]: '{"a": 1, "b": 2}'
Method
class MemoryStorage(BaseStorage): def __init__(self, prefix='pywe'): class RedisStorage(BaseStorage): def __init__(self, redis, prefix='pywe'):
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
pywe-storage-1.0.0.tar.gz
(2.3 kB
view details)
Built Distribution
File details
Details for the file pywe-storage-1.0.0.tar.gz
.
File metadata
- Download URL: pywe-storage-1.0.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09d9d930f17f2cd0e5d30ef67842315cea7507c36fffcb7455cb9918547162fa |
|
MD5 | 0ab284f57602c6d04cbf423115ee836e |
|
BLAKE2b-256 | 1b0afa1edb88f63ba748be5e44a0ff5a1d7646c80e9a5fc4b136fdcbcd59d3da |
File details
Details for the file pywe_storage-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: pywe_storage-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d2e3421baa84e0b48291e61ae23215af851b3f0dbd95623697e3f9f09695e16 |
|
MD5 | c2d7b5515f32232295be583884f7c3f4 |
|
BLAKE2b-256 | 20dae93d65a926318913d419c3ee3110756197a53ab007e40d5155770b88d06a |