Skip to main content

A Pyrogram session storage implementation backed by Redis.

Note: The hooks will not work until Pyrogram merge #6b37046 or use patched my pyrogram patched version.

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()

Metadata

Release files for pyroredis 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyroredis 0.1.1
File Size Uploaded
pyroredis-0.1.1.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyroredis 0.1.1
File Interpreter ABI Platform
pyroredis-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 kB

Release files / pyroredis-0.1.1.tar.gz

Download URL pyroredis-0.1.1.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9d910142c04d24941f8746052bd01622f0cd67a8d445bb3f41bd7b919528ab4f
BLAKE2b-256 checksum
How to use checksums
1c0f4381e3b78546ad0b4c0bea7722c5d9e153a1c28183fb7ee564ae47968207
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pyroredis-0.1.1-py3-none-any.whl

Download URL pyroredis-0.1.1-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
416de353676a9952dde664bfccd66ff6701524118f23b1d66e4bb281fc48321d
BLAKE2b-256 checksum
How to use checksums
5aa03291718bf9679840455877b024ccfffbb231fd81e20075615c8cd753af12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page