Skip to content

Redis storage manager. CRUD (Create, Read, Update, Delete) for Redis.

License

Notifications You must be signed in to change notification settings

smartlegionlab/smart_redis_storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smart_redis_storage 0.1.1

Redis storage manager.


GitHub top language PyPI - Downloads GitHub release (latest by date) GitHub PyPI PyPI - Format GitHub Repo stars GitHub watchers GitHub forks


Author and developer: A.A. Suvorov


Help:

pip install smart-redis-storage

CRUD (Create, Read, Update, Delete) for Redis. Used in a large corporate project in a multi-user CRM (Django) to store intermediate data. I used user ids as uniq_key.

from smart_redis_storage.redis_storage import RedisStorageManager

user_id = 1
redis_storage_manager = RedisStorageManager()
redis_storage_manager.set_data(uniq_key=user_id, key='data', value={'id': 1, 'age': 33})
data = redis_storage_manager.get_data(uniq_key=user_id, key='data')
print(data) # {'id': 1, 'age': 33}
print(type(data)) # <class 'dict'>

Disclaimer of liability:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright:

--------------------------------------------------------
Licensed under the terms of the BSD 3-Clause License
(see LICENSE for details).
Copyright © 2018-2024, A.A. Suvorov
All rights reserved.
--------------------------------------------------------