Skip to main content

Model Redis data structures

Project description

aioredis-models

A wrapper over aioredis that models Redis data as simple data structures.

GitHub PyPI

GitHub Workflow Status (event) Documentation Status codecov GitHub Workflow Status

Supported data structures

  • Keys
  • Strings
  • Lists
  • Hash maps
  • Sets
  • Double hash maps

Requirements

Documentation

Detailed documentation is available at https://aioredis-models.readthedocs.io/.

Usage

Construction of all data structures requires at least an aioredis.Redis instance and a key. For example, to create a RedisString:

from aioredis-models import RedisString

redis_string = RedisString(redis, 'my-string')

Once a model has been constructed, various functions can be used to interact with it.

import aioredis
from aioredis-models import RedisString

async def do_work(redis_string: RedisString):
  stored_value = await redis_string.get()
  print(stored_value)

Contributing

The library is currently in very early stages of development and there is a lot of room for growth. As such, contributions are welcome. To contribute, create a pull request into the main branch. Make sure the tests pass and there are no linting errors. Also, please update documentation, if needed.

Testing

The easiest way to run the tests is through docker-compose and Docker:

docker-compose up --build unit-test

To run directly on the host:

pip3 install -r requirements.txt
tox

Linting

Similar to testing, linting rules can be run through:

docker-compose up --build lint

To run directly on the host:

pip3 install -r requirements.txt
pylint aioredis_models

Documentation

Documentation can get regenerated by starting the generate-docs service in docker-compose:

docker-compose up --build generate-docs

To run directly on the host:

pip3 install -r requirements.txt
sphinx-apidoc -f -o docs/source aioredis_models && (cd docs && make html)

License

This library is offered under the MIT license.

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

aioredis-models-2.0.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

aioredis_models-2.0.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file aioredis-models-2.0.0.tar.gz.

File metadata

  • Download URL: aioredis-models-2.0.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for aioredis-models-2.0.0.tar.gz
Algorithm Hash digest
SHA256 91963bdd794151d38a018e7ad5de2f523013ddea1145d6ddc6a2fa2434aaca6c
MD5 2be87e57f7969f0110702b29e12d0bfc
BLAKE2b-256 e16d60f3a2f6273bd9f05c480be174fb5b67bed87ecc50d7fe26c6f638dad5e9

See more details on using hashes here.

File details

Details for the file aioredis_models-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: aioredis_models-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for aioredis_models-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f40979228b2767ebe45fa304e04ea762a7e0f7a12f48a32734602543780c61c5
MD5 b090b1b86798b8a137cfa0c094c347e0
BLAKE2b-256 f1bfb9eedb8a0aaa57d2102aac1069212441f6f5d0ae14bd6217ddfe793c3f50

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