🎲 DiceDB Python Client
Welcome to the DiceDB Python Client! This project provides an efficient way to interact with DiceDB using Python, managing connection pools and executing commands with ease.
How to Install
pip install dicedb-py
OR
poetry add dicedb-py
📝 Usage
import asyncio
from dicedb_py import Dice
async def main():
dice = Dice(host="localhost", port=7379)
print(await dice.set("foo", "bar"))
val = await dice.get("foo")
print(val)
if __name__ == "__main__":
asyncio.run(main())
🛠️ Commands
-
SET: set key-value
Ex:await dice.set("key", "val) -
GET: get value from key
Ex:await dice.get("key") -
DEL: delete key
Ex:await dice.delete("key") -
EXISTS: check if a key exists & returns bool
Ex:await dice.exists("key") -
EXPIRE: sets ttl in seconds for a key
Ex:await dice.expire("key", 10) -
KEYS: get all keys in a list according to the pattern give. Use "_" for all keys.
Ex:await dice.keys("_") -
FLUSH: clear all keys
Ex:await dice.flush() -
INCR: incr key by 1. Default value to start is 0 if key is not already set.
Ex:await dice.incr("key") -
INCRBY: incr key by amount (int)
Ex:await dice.incrby("key", 2) -
DECR: decr key by 1.
Ex:await dice.decr("key") -
DECRBY: decr key by amount (int)
Ex:await dice.decrby("key", 2) -
TTL: get TTL (time to live) of the key in seconds
Ex:await dice.ttl("key")
Metadata
Release files for dicedb-py 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dicedb_py-0.0.2.tar.gz | 4.5 kB | Without provenance | Details for dicedb_py-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dicedb_py-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for dicedb_py-0.0.2-py3-none-any.whl |
Total release size: 11.0 kB
Release files / dicedb_py-0.0.2.tar.gz
| Download URL | dicedb_py-0.0.2.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3e06f3fc704418f726915102768228e8c7f198781480e21e5c8f94def29c896
|
|
BLAKE2b-256 checksum How to use checksums |
fe9c77ea457b836f405efbe4510e86fe6e041e3d0bad2d565f52fe47a050f125
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.10.15 Linux/6.5.0-1025-azure
|
Release files / dicedb_py-0.0.2-py3-none-any.whl
| Download URL | dicedb_py-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b583f8780926a2159d953ee0066ef3f6372ddfa9fe82d3bac0c718a9c2041056
|
|
BLAKE2b-256 checksum How to use checksums |
e83db1d6bb6bd3d39d56ed7b23332a8c358ba654cb0b39e967b0012bcce8c411
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.10.15 Linux/6.5.0-1025-azure
|
Security for dicedb-py 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.