Skip to main content

A Telethon session storage that runs on Azure Cosmos DB (SQL API)

Project description

Telethon Cosmos DB SQL API Sesion

This is a Telethon session backend which uses Cosmos DB (SQL API).

In short, it allows Telethon to store session in Cosmos DB via SQL API.

Installing

pip3 install telethon-cosmosdb-sqlsession

Upgrading

pip3 install -U telethon-cosmosdb-sqlsession

Usage

from telethon import TelegramClient
from telethoncosmosdb import CosmosDBSQLSession

api_id = 123456
api_hash = "0123456789abcdef0123456789abcdef"
COSMOS_ENDPOINT = 'https://database-endpoint.documents.azure.com:443/'
COSMOS_KEY = 'Cosmos DB key here=='
COSMOS_DBNAME = 'database'

# The first parameter 'user' means the session will create containers with suffix 
# '_user' in the names to avoid any possible name collision (What would happen will happen).
session = CosmosDBSQLSession('user', COSMOS_ENDPOINT, COSMOS_KEY, COSMOS_DBNAME)
client = TelegramClient(session, api_id, api_hash)

Disclaimer

This packages assumes your data is well-encrypted in Cosmos DB, and therefore does not encrypt your session data.

This package comes with no warranty. I am not responsible for any damages resulted from using this package.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telethon-cosmosdb-sqlsession-0.1.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

telethon_cosmosdb_sqlsession-0.1.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file telethon-cosmosdb-sqlsession-0.1.1.tar.gz.

File metadata

  • Download URL: telethon-cosmosdb-sqlsession-0.1.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.1

File hashes

Hashes for telethon-cosmosdb-sqlsession-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1cfb729713ee2203059f26b832f1a514d4ab492a52d6bf1ed9035c0e5cf9814c
MD5 304be808e060ddded5a157bc0639b7c8
BLAKE2b-256 f79511ce6bb604cf39f48a21145367f46559e3c6d3be1facb85ff6cae1685284

See more details on using hashes here.

File details

Details for the file telethon_cosmosdb_sqlsession-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: telethon_cosmosdb_sqlsession-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.1

File hashes

Hashes for telethon_cosmosdb_sqlsession-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26aa25e57f5ae81559466dc3d5cd432504a83ee662431d8334930b6b469fe58a
MD5 deadeec0373a28c8b0b284dfa22fcbfd
BLAKE2b-256 4f771c91c3b393592fd42966ae35c65a709bd03d881f5408417fe822796ab520

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page