Redis backend for Pyrogram session storage
Project description
A Pyrogram session storage implementation backed by Redis.
Note: The hooks will not work until Pyrogram merge #6b37046.
Usage
This session implementation can store multiple Sessions in the same key hive.
Installing
pip3 install pyroredis
Upgrading
pip3 install -U pyroredis
Quick start
from pyrogram import Client from pyroredis import RedisSession import redis # These example values won't work. You must get your own api_id and # api_hash from https://my.telegram.org, under API Development. api_key = 12345 api_hash = '0123456789abcdef0123456789abcdef' session_name = "798xxxxxxx7" redis_connector = redis.Redis(host='localhost', port=6379, db=0, decode_responses=False) redis_session = RedisSession(redis_connector) client = Client(session_name=session_name, api_key=(api_key, api_hash)) client.load_session_hook = redis_session.load_session client.save_session_hook = redis_session.save_session client.start()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyroredis-0.1.0.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for pyroredis-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29cd543e87af3361869c718ed318df8bdbfab96a401dce973318ed092b3ec30b |
|
MD5 | 29428c16f14307ed9e8ea8b7738dcd86 |
|
BLAKE2b-256 | fb4cea20e6130cb694fefe9a50cc300087716c231179aa83dacc29f5ff7e42bf |