Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.
/ redis_dumper Public archive

CLI utility and library for creating encrypted redis dump.

License

Notifications You must be signed in to change notification settings

DavisDmitry/redis_dumper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redis Dumper

PyPI - Python Version PyPI - Downloads PyPi Package Version GitHub Workflow Status (branch) GitHub

CLI utility and library for creating encrypted redis dump.

Install

pip install redis_dumper

Use in CLI

redis_dumper [OPTIONS] COMMAND [ARGS]...

Use in your code

Examples:

import io
import aioredis
import redis_dumper


REDIS_ADDR = 'redis://10.0.0.1:6379'
PASSWORD = 'qwerty'
FILE_PATH = 'mydump.rdump'


async def dump_to_file_example():
    await redis_dumper.dump_to_file(REDIS_ADDR, PASSWORD, FILE_PATH)


async def dump_to_bytesio_example():
    dump = await redis_dumper.dump_to_bytesio(REDIS_ADDR, PASSWORD)


async def restore_from_file_example():
    await redis_dumper.restore_from_file(REDIS_ADDR, PASSWORD, FILE_PATH)


async def restore_from_bytesio_example(dump: io.BytesIO):
    await redis_dumper.restore_from_bytesio(REDIS_ADDR, PASSWORD, dump)


# you can also use the already created aioredis.Redis instance
async def example_with_created_redis():
    redis = await aioredis.create_redis(REDIS_ADDR)
    dump = await redis_dumper.dump_to_bytesio(redis, PASSWORD)