Skip to main content

Model Redis data structures

Project description

aioredis-models

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

Supported data structures

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

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 to execute the ./test.sh script. This requires Docker to be installed and running. The following can be used to run without Docker:

pip3 install -r requirements.txt
tox

Linting

Similar to testing, linting rules can be run by executing the ./lint.sh script. To run without Docker:

pip3 install -r requirements.txt
pylint aioredis_models

Documentation

Documentation can get regenerated using ./generate-docs.sh script. To run without Docker:

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-1.0.0.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

aioredis_models-1.0.0-py3-none-any.whl (9.2 kB view hashes)

Uploaded Python 3

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