Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_redis_ds-0.0.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_redis_ds-0.0.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

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

Hashes for py_redis_ds-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6e39f8ce8fc4b178221f757c1771599169c842e98195761713b0e89e8ed3e86e
MD5 65cc8300b1489a6bc4878caa832c25a9
BLAKE2b-256 4c61301d1c9b76501beae57b2ba1116aa15b5ef11d43395ff2cf3371fee790a6

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for py_redis_ds-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ff442c276bc11a9ffe772db1a79ad328f22b4cffb27090494c7e12a2db12a23
MD5 4db5e70ecffb92651299bad6c3c3be3c
BLAKE2b-256 5220e624ed45ad01996698ad5ad0cc18a4115d56961e0e4e3e2027e4761132c7

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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