Drop-in replacements for Python data structures backed by Redis for shared access.
Project description
Redis-Backed Data Structures for Python
Redis-backed Python data structures that function like built-ins but store data on a Redis server, enabling shared access across distributed systems.
🚀 Features
- Drop-in Replacements: Use familiar Python data structures (
list,dict,set, etc.) with minimal changes to your code. - Redis-Powered: Data is stored on the Redis server, enabling easy sharing across processes, services, or systems.
- Seamless Integration: Works like native Python data structures while leveraging Redis for distributed use cases.
📥 Installation
Install the library using pip:
pip install py_redis_ds
💡 Usage
Here’s a quick example of how to use a Redis-backed list:
from py_redis_ds.builtins import List
from redis import Redis
redis = Redis()
# Initialize a Redis-backed list
rlist = List(name="my_shared_list", redis=redis)
# Add elements
rlist.append("Hello")
rlist.append("World")
# Access elements
print(rlist[0]) # Output: Hello
# Iterate through the list
for item in rlist:
print(item)
# Shared access in another script or service
rlist2 = List(name="my_shared_list", redis=redis)
print(rlist2[1]) # Output: World
📚 Supported Data Structures
| Data Structure | Redis-Backed Equivalent |
|---|---|
list |
py_redis_ds.builtins.List |
dict |
py_redis_ds.builtins.Dict |
set |
py_redis_ds.builtins.Set |
queue.Queue |
py_redis_ds.queue.Queue |
queue.LifoQueue |
py_redis_ds.queue.LifoQueue |
queue.PriorityQueue |
py_redis_ds.queue.PriorityQueue |
collections.deque |
py_redis_ds.collections.Deque |
collections.defaultdict |
py_redis_ds.collections.DefaultDict |
(Support for more data structures coming soon!)
🌟 Why Use Redis-Backed Structures?
- Shared State: Easily share data between processes, microservices, or distributed systems.
- Scalability: Offload data storage to Redis, reducing memory usage in individual processes.
- Simplicity: Use familiar Python syntax while leveraging Redis's power.
🤝 Contributing
Contributions are welcome! Please check out our CONTRIBUTING.md for guidelines.
📜 License
This project is licensed under the MIT License. See the LICENSE file for details.
We’re excited to see how you use Redis-Backed Data Structures! If you have any questions or feedback, feel free to open an issue or start a discussion.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_redis_ds-0.0.1.tar.gz.
File metadata
- Download URL: py_redis_ds-0.0.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e39f8ce8fc4b178221f757c1771599169c842e98195761713b0e89e8ed3e86e
|
|
| MD5 |
65cc8300b1489a6bc4878caa832c25a9
|
|
| BLAKE2b-256 |
4c61301d1c9b76501beae57b2ba1116aa15b5ef11d43395ff2cf3371fee790a6
|
Provenance
The following attestation bundles were made for py_redis_ds-0.0.1.tar.gz:
Publisher:
python-publish.yml on bhavya-tech/python-redis-datastructures
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_redis_ds-0.0.1.tar.gz -
Subject digest:
6e39f8ce8fc4b178221f757c1771599169c842e98195761713b0e89e8ed3e86e - Sigstore transparency entry: 189752117
- Sigstore integration time:
-
Permalink:
bhavya-tech/python-redis-datastructures@83b5fb1606dd5f795e598029e6d70f2b6ba52796 -
Branch / Tag:
refs/tags/0.0.1 - Owner: https://github.com/bhavya-tech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@83b5fb1606dd5f795e598029e6d70f2b6ba52796 -
Trigger Event:
release
-
Statement type:
File details
Details for the file py_redis_ds-0.0.1-py3-none-any.whl.
File metadata
- Download URL: py_redis_ds-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ff442c276bc11a9ffe772db1a79ad328f22b4cffb27090494c7e12a2db12a23
|
|
| MD5 |
4db5e70ecffb92651299bad6c3c3be3c
|
|
| BLAKE2b-256 |
5220e624ed45ad01996698ad5ad0cc18a4115d56961e0e4e3e2027e4761132c7
|
Provenance
The following attestation bundles were made for py_redis_ds-0.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on bhavya-tech/python-redis-datastructures
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_redis_ds-0.0.1-py3-none-any.whl -
Subject digest:
6ff442c276bc11a9ffe772db1a79ad328f22b4cffb27090494c7e12a2db12a23 - Sigstore transparency entry: 189752119
- Sigstore integration time:
-
Permalink:
bhavya-tech/python-redis-datastructures@83b5fb1606dd5f795e598029e6d70f2b6ba52796 -
Branch / Tag:
refs/tags/0.0.1 - Owner: https://github.com/bhavya-tech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@83b5fb1606dd5f795e598029e6d70f2b6ba52796 -
Trigger Event:
release
-
Statement type: