Skip to main content

A set of tools for simplifying reading and writing of single values to/from Redis.

Project description

PyRedisEasyIO

A project to simplify reading/writing single objects from/to redis

Description

Redis is a great way to share data between applications - or processes in an application. However, in its raw form, the application has to deal with data type conversion to/from string, check for existence, and other pesky stuff. It would be nice if that were abstracted in such a way to where it didn't appear in code that redis was being used at all.

This project seeks to allow the exchange of single data points in a readable way, eg. my_data.my_value = 30 (automatically writes '30' to redis)

Installation

pip install pyrediseasyio

Usage

The basis of functionality is the IOGroup class. It acts as a container for individual values and performs the behind-the-scenes reads and writes.

from io_group import IOGroup
from single_io import BooleanIO, IntIO, FloatIO


class TestGroup1(IOGroup):
    Bool1 = BooleanIO("Boolean 1", "Bool1", False)
    Bool2 = BooleanIO("Boolean 2", "Bool2", True)
    Int1 = IntIO("Integer 1", "Int1")
    Int2 = IntIO("Integer 2", "Int2", default=34)
    Float1 = FloatIO("Float 1", "Float1", default=1.2)

class TestGroup2(IOGroup):
    Bool1 = BooleanIO("Boolean 1", "Bool1", False)
    Bool2 = BooleanIO("Boolean 2", "Bool2", True)
    Int1 = IntIO("Integer 1", "Int1")
    Int2 = IntIO("Integer 2", "Int2", default=34)
    Float1 = FloatIO("Float 1", "Float1", default=1.2)


group1a = TestGroup1()
group1b = TestGroup1()
group2 = TestGroup2()

group1a.Float1 = 1234.5
print(group1b.Float1.value)
print(group2.Float1.value)

That is really all there is to it. For more specific cases, see the unit tests.

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

pyrediseasyio-0.0.14.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

pyrediseasyio-0.0.14-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file pyrediseasyio-0.0.14.tar.gz.

File metadata

  • Download URL: pyrediseasyio-0.0.14.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for pyrediseasyio-0.0.14.tar.gz
Algorithm Hash digest
SHA256 8d02357acba1067696e6a702c196b4bea1d9be4be9b5fea1b4efebd0822f9d65
MD5 1f70f7694f2b9f26ad41d059ba7be6bf
BLAKE2b-256 2e9974ca61e9c6151a6a2c278f13b9279cbdae59ea32b328feecde5c0c68dbbf

See more details on using hashes here.

File details

Details for the file pyrediseasyio-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: pyrediseasyio-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for pyrediseasyio-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 474519fe2a7604d360c5bfe4545f7b4c01ecb9a4d8c1c9174735c327ea16d620
MD5 99ab01eebb9f7c6c185f29ce55ce2e7a
BLAKE2b-256 fbfd06cb8082cdd3d8831d4b88aca20da37531c32c9131369e602c58b84dd53e

See more details on using hashes here.

Supported by

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