# pyromongo
## INTRODUCTION
Persistent Session Storage for Pyrogram with MongoDB
```python
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.
```python
async def main():
async with Client(..) as client:
client.storage = MongoStorage(..)
# It will only store peers
```
### INSTALLATION:
```bash
pip install pyromongo
pip install git+https://github.com/animeshxd/pyromongo
```
Install dnspython for `mongo+srv://..` URIs
```bash
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
```bash
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
Raw data
{
"_id": null,
"home_page": "https://github.com/animeshxd/pyromongo",
"name": "pyromongo",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7.0",
"maintainer_email": null,
"keywords": "async mongo session storage pyrogram",
"author": "Animesh Murmu",
"author_email": "am2646374@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/19/ca/418e4a2cf97a76f0f8edc5e61bdfc874abd2385e88bc107c479ae34c32e9/pyromongo-0.0.8.tar.gz",
"platform": null,
"description": "# pyromongo\n## INTRODUCTION \nPersistent Session Storage for Pyrogram with MongoDB\n\n```python\nfrom pyrogram.client import Client\nfrom pyromongo import MongoStorage\nfrom motor.motor_asyncio import AsyncIOMotorClient\n\nclient = Client(..)\nmongo = AsyncIOMotorClient(\"mongodb+srv://..\")\nclient.storage = MongoStorage(mongo[\"pyrogram\"], remove_peers=False) # use remove_peers=True to remove all peers on logout\n\n\nclient.run()\n```\n## Note:\n \u274c It will not work with the pyrogram context manager.\n ```python\n async def main():\n async with Client(..) as client:\n client.storage = MongoStorage(..)\n \n # It will only store peers\n ```\n ### INSTALLATION:\n ```bash\n pip install pyromongo\n \n pip install git+https://github.com/animeshxd/pyromongo\n ```\n Install dnspython for `mongo+srv://..` URIs\n ```bash\n pip install dnspython\n # or pip install -U pyromongo[srv]\n \n # for Termux use dnspython fork\n apt install resolv-conf\n pip install git+https://github.com/animeshxd/dnspython\n ```\n Install with all extra dependencies\n ```bash\n pip install \"pyromongo[gssapi,aws,ocsp,snappy,srv,zstd,encryption]\"\n ```\n Check other required dependencies for motor\n https://motor.readthedocs.io/en/stable/installation.html#dependencies\n \n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Mongo Session Storage for pyrogram",
"version": "0.0.8",
"project_urls": {
"Homepage": "https://github.com/animeshxd/pyromongo"
},
"split_keywords": [
"async",
"mongo",
"session",
"storage",
"pyrogram"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bc4fdbf90dae0affb758a1894e2cab2b4d7b0fcd40af477b3f7ae103f2ad575f",
"md5": "915faa37050071c924ff5331a2742d4e",
"sha256": "90b4f5b05893308713c322a919372d87a0e7a0afccbb2778b9093e8d3dbad6ab"
},
"downloads": -1,
"filename": "pyromongo-0.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "915faa37050071c924ff5331a2742d4e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7.0",
"size": 4169,
"upload_time": "2024-04-15T08:20:57",
"upload_time_iso_8601": "2024-04-15T08:20:57.226626Z",
"url": "https://files.pythonhosted.org/packages/bc/4f/dbf90dae0affb758a1894e2cab2b4d7b0fcd40af477b3f7ae103f2ad575f/pyromongo-0.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "19ca418e4a2cf97a76f0f8edc5e61bdfc874abd2385e88bc107c479ae34c32e9",
"md5": "430925189190f99d6bc80b19a3e2f7b8",
"sha256": "5092b7049152a2e1785fe707f55b6ee4984a1fda3998331c8cb34cf16dece66c"
},
"downloads": -1,
"filename": "pyromongo-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "430925189190f99d6bc80b19a3e2f7b8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7.0",
"size": 4036,
"upload_time": "2024-04-15T08:20:58",
"upload_time_iso_8601": "2024-04-15T08:20:58.423569Z",
"url": "https://files.pythonhosted.org/packages/19/ca/418e4a2cf97a76f0f8edc5e61bdfc874abd2385e88bc107c479ae34c32e9/pyromongo-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-15 08:20:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "animeshxd",
"github_project": "pyromongo",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "motor",
"specs": []
},
{
"name": "pymongo",
"specs": []
},
{
"name": "Pyrogram",
"specs": []
}
],
"lcname": "pyromongo"
}