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
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.0a1.tar.gz (5.7 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.0a1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file py_redis_ds-0.0.0a1.tar.gz.

File metadata

  • Download URL: py_redis_ds-0.0.0a1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for py_redis_ds-0.0.0a1.tar.gz
Algorithm Hash digest
SHA256 107cea760ea54e219253c1c62fc22b632b40895b239d72cfbfcb5dbf32fe115a
MD5 ac4912701a97a70c907038a6a99a4f76
BLAKE2b-256 4b277e684ec840b692b92317c4f7a16b375b4ea0c0fa8a99ccf77c02e4ba7c13

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_redis_ds-0.0.0a1.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.0a1-py3-none-any.whl.

File metadata

  • Download URL: py_redis_ds-0.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for py_redis_ds-0.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 740dad3c565dcc1ffb181f2cd060dcf07887531947f6c37e781267ff1a91dfd9
MD5 9d203dc882b8d4e40a79a3612add136c
BLAKE2b-256 15ea0c8c9c9d6247292b1fad3196407bdc66f8062955e766cd1c787bdc0b87f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_redis_ds-0.0.0a1-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