Based on python's dict bottom layer, it implements management similar to redis interface

Related tags

Admin Panels pydis
Overview

pydis

Based on python's dict bottom layer, it implements management similar to redis interface

If you want to manage memory like redis, but don't want to introduce as many services as redis, you can use pydis, Of course, pydis is completely implemented based on python's dict, and only has the basic functions of reids. Please evaluate this carefully before using it.

install

pip install pydictdis

Usage

params

  • default_timeout : 全局的timeout,如果在设置key没有指定timeout的话,就会应用该timeout

simple usage

from pydis import Pydis
manager = Pydis()

manager.set("key1", "value1")
manager.get("key1")  # value1

manager.delete("key1")
manager.get("key1")  # None

ttl usage

from pydis import Pydis
manager = Pydis()
manager.set("key2", "value2", timeout=10)
print(manager.ttl("key2"))
# wait 10 seconds
manager.get("key2") # return None, because key2 already expired

incr and decr usage

from pydis import Pydis
manager = Pydis()

manager.set("key3", 0)
manager.incr("key3")
manager.incr("key3")
manager.incr("key3")
print(manager.get("key3"))  # 3

manager.decr("key3")
print(manager.get("key3"))  # 2

keys usage

from pydis import Pydis
manager = Pydis()

manager.set("key1", "value1")
print(list(manager.keys()))  # ["keys"]

set_nx

from pydis import Pydis
manager = Pydis()

manager.set_nx('key1', 'value')
manager.set_nx('key1', 'value1')
manager.get('key1')  # value
You might also like...

The PenTesters Framework (PTF) is a Python script designed for Debian/Ubuntu/ArchLinux based distributions to create a similar and familiar distribution for Penetration Testing.

The PenTesters Framework (PTF) is a Python script designed for Debian/Ubuntu/ArchLinux based distributions to create a similar and familiar distribution for Penetration Testing.

Penetration Tools Framework (PTF) The PenTesters Framework (PTF) is a Python script designed for Debian/Ubuntu/ArchLinux based distributions to create

Jul 31, 2022

A task queue based on redis that can serve as a peak shaver and protect your app.

A task queue based on redis that can serve as a peak shaver and protect your app.

fastapi-queue A python implementation of a task queue based on Redis that can serve as a peak shaver and protect your app. 中文文档 What is fastapi-queue?

Nov 6, 2022

This project implements the neural network training and testing pipeline based on PyTorch Lightning.

A Machine Learning Template based on Pytorch Lightning This project implements the neural network training and testing pipeline based on PyTorch Light

Aug 14, 2022

Implements a REST API using proper resource based URLs, pagination, status codes, and user authentication/authorization

Cloud Application Implements a REST API using proper resource based URLs, pagination, status codes, and user authentication/authorization. Application

Sep 11, 2022

A student management system with tkinter for interface and with mysql-DBMS to store student information and manage student information

a student management system with tkinter for interface and with mysql-DBMS to store student information and manage student information

Nov 1, 2022

DSM-tui (Decks Server Manager TUI) is a tool that allows server management by viewing active services and server status. It is developed in python with TUI (Terminal User Inteface) interface

DSM-tui (Decks Server Manager TUI) is a tool that allows server management by viewing active services and server status. It is developed in python with TUI (Terminal User Inteface) interface

DSM-TUI Documentation Description DSM-TUI (Decks Server Manager TUI) is a tool that allows server management by viewing active services and server sta

Nov 5, 2022

📦 PyTorch based visualization package for generating layer-wise explanations for CNNs.

📦 PyTorch based visualization package for generating layer-wise explanations for CNNs.

Explainable CNNs 📦 Flexible visualization package for generating layer-wise explanations for CNNs. It is a common notion that a Deep Learning model i

Nov 21, 2022

Speech-Driven Expression Blendshape Based on Single-Layer Self-attention Network (AIWIN 2022)

Speech-Driven Expression Blendshape Based on Single-Layer Self-attention Network (AIWIN 2022)

Speech-Driven Expression Blendshape Based on Single-Layer Self-attention Network HelloWorld: 9th (Third Prize) For more contest details, please refer

Nov 22, 2022

LRGCNCDA, which effectively predicts the association between circRNA and disease, is a method based on layer-refined graph convolutional networks.

License Copyright (C) 2022, Cheng Yang ([email protected]) This program is free software; you can redistribute it and/or modify it under the terms

Oct 25, 2022
Comments
  • Refactor, CI & docs

    Refactor, CI & docs

    commit 较乱,如果要 merge 建议 squash 成一个 commit

    • [x] 修复 README 内的 typo
    • [x] 增加 README Lint CI
    • [x] 修改了 incr 和 decr,共用一个 _incr
    • [x] 修改 keys 函数的逻辑
    • [x] 增加 clean 和 clean_force 函数
    • [x] CodeQL 代码扫描
    • [x] README 双语 & badge
    • [x] 增加发版 CI
    • [x] 增加代码 Lint CI
    • [x] 文档框架
    opened by YuzhenQin 3
  • 支持容器(container)

    支持容器(container)

    支持下列用法

    from pydis import Pydis
    manager = Pydis()
    
    manager.set_many({'key1': 'value1', 'key2': 'value2', 'key3': 'value3'})
    
    for k, v in enumerate(manager):
        print(k, manager[k], v)
    del manager['key1']
    manager['key4'] = 'value4'
    
    opened by luohuayouyi12138 1
  • 修改配置传入的方式

    修改配置传入的方式

    现在的default_timeout是在实例化的时候传入,这个就导致了只有在第一次实例化的时候才会生效,但是后面也传入了,会产生歧义

    from pydis import Pydis
    
    
    p = Pydis(default_timeout=10)
    
    p = Pydis(default_timeout=20)  # default_timeout still is 10
    
    
    
    feature 
    opened by Zombie123456 2
Owner
null
RedisTimeseriesManager is a redis timeseries management system that enhance redis timeseries with features including multi-line data, built-in timeframes, data classifiers and convenient data accessors.

RedisTimeseriesManager RedisTimeseriesManager is a redis timeseries management system that enhance redis timeseries with features including multi-line

Ahmad Azizi 2 Nov 17, 2022
In this Repo there are many small and big pythons projects are there Created By me! i hope you will enjoy! Thank you

Python-Projects In this Repo there are many small and big pythons projects are there Created By me! i hope you will enjoy! Thank you *********** 1.Fir

DHRUV TILVA 2 Aug 25, 2022
Fake implementation of redis API (redis-py) for testing purposes

fakeredis: A fake version of a redis-py fakeredis: A fake version of a redis-py How to Use Use to test django-rq Other limitations Support for redis-p

null 68 Nov 21, 2022
This repo provides a Weight Conversion Tool which can be used to export a Yolov5 model (e.g., yolov5s.pt) to a CoreML model (e.g., yolov5s.mlmodel) with a decoding layer and an non maximum suppression layer (NMS).

English | 简体中文 Introduction This repo provides a Weight Conversion Tool which can be used to export a Yolov5 model (e.g., yolov5s.pt) to a CoreML mode

Xiaorong Ren 4 Oct 25, 2022
Alexa Official Management An Anime Themed Telegram Group Management Bot. Telegram Management Bot For Your Group Love U All

❤️ Alexa Management Bot V1 ❤️ Rocks Alexa A Powerful, Smart And Simple Group Manager ... Written with AioGram , Pyrogram and Telethon... ⭐️ Thanks to

Team Alexa 4 Oct 28, 2022
Shared, streaming Python dict

UltraDict Sychronized, streaming Python dictionary that uses shared memory as a backend Warning: This is an early hack. There are only few unit tests

Ronny Rentner 187 Nov 29, 2022
Author: Wenhao Yu ([email protected]). ACL 2022 Dict-BERT: Enhancing Language Model Pre-training with Dictionary

Dict-BERT: Enhancing Language Model Pre-training with Dictionary Introduction -- This is the pytorch implementation of our ACL 2022 paper "Dict-BERT:

Wenhao Yu 43 Nov 23, 2022
A library for users to write (experiment in research) configurations in Python Dict or JSON format, while can read parameters from the command line.

请您Star Please Star 如果你觉得此工具不错,请轻轻点击此页面右上角Star按钮增加项目曝光度,谢谢! If you think this tool is good, please gently click the Star button in the upper right corn

Naibo Wang 1.3k Nov 25, 2022
Benchmarking for dot-accessible dict packages in python

dotdict-bench Benchmarking for dot-accessible dict packages in python More test ideas? Submit an issue! Package Information As of 2022-09-21 23:11:19.

null 1 Sep 22, 2022
FastAPI-User-Auth is a simple and powerful FastAPI user RBAC authentication and authorization library. Based on FastAPI-Amis-Admin and provides a freely extensible visual management interface.

项目介绍 FastAPI-User-Auth FastAPI-User-Auth是一个简单而强大的FastAPI用户RBAC认证与授权库. 基于FastAPI-Amis-Admin并提供可自由拓展的可视化管理界面. 源码 · 在线演示 · 文档 · 文档打不开? FastAPI-User-Auth是

AmisAdmin 151 Nov 23, 2022