Mongo Session Storage for pyrogram
Project description
pyromongo
INTRODUCTION
Persistent Session Storage for Pyrogram with MongoDB
from pyrogram.client import Client
from pyromongo import MongoStorage
from motor.motor_asyncio import AsyncIOMotorClient
client = Client(..)
mongo = AsyncIOMotorClient("mongodb+srv://..")
client.storage = MongoStorage(mongo["pyrogram"], remove_peers=False) # use remove_peers=True to remove all peers on logout
client.run()
Note:
❌ It will not work with the pyrogram context manager.
async def main():
async with Client(..) as client:
client.storage = MongoStorage(..)
# It will only store peers
INSTALLATION:
pip install pyromongo
pip install git+https://github.com/animeshxd/pyromongo
Install dnspython for mongo+srv://..
URIs
pip install dnspython
# or pip install -U pyromongo[srv]
# for Termux use dnspython fork
apt install resolv-conf
pip install git+https://github.com/animeshxd/dnspython
Install with all extra dependencies
pip install "pyromongo[gssapi,aws,ocsp,snappy,srv,zstd,encryption]"
Check other required dependencies for motor https://motor.readthedocs.io/en/stable/installation.html#dependencies
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
pyromongo-0.0.6.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for pyromongo-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c0b82908c92d3c4cba7dd6222f139071f67dfc7720b01f584865eaa56cb5f9c |
|
MD5 | 8e6e29ae5c961f2dcd8d9a8f019e47b6 |
|
BLAKE2b-256 | 580b2810464cd020d47c87c51a1136cce1d7870dc56fa627353c502cff80f062 |