Skip to main content

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


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.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

pywe_storage-1.0.1-py2.py3-none-any.whl (5.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pywe-storage-1.0.1.tar.gz.

File metadata

File hashes

Hashes for pywe-storage-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2a0a70d436633d6eb14f1730812dea1af0f3c8e98bf4d8610555942362e354c4
MD5 8858900c17ba31a33d67c0d9323e9e19
BLAKE2b-256 3bc280eb273950cfef6051386587c333feaf26f7f40525c19e120129984d72f4

See more details on using hashes here.

File details

Details for the file pywe_storage-1.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pywe_storage-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8369bbccb41ae923a5558a1fa61a02054ba1aafb083835f98f92cbba89155735
MD5 62b6a24edfa8b9dbd012e6d8e6199e5a
BLAKE2b-256 bb16a7b241c6e052b72ab5cdc173b22c4511e72e6a3a59d84adde459a81c3172

See more details on using hashes here.

Supported by

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