Skip to main content

A library that uses your telegram account as a database for your project.

Project description

TelegramDB

A library which uses your telegram account as a database for your projects.

Basic Usage

from pyrogram import Client
from telegram import TelegramDB, DataPack, Member

client = Client("session_name", getenv("API_ID"), getenv("API_HASH"))
client.start()
SESSION = TelegramDB(client, getenv("DB_CHAT_ID"))

class TestData(DataPack):
    __datapack_name__ = "test"

    id = Member(int, is_primary=True)
    name = Member(str)

    def __init__(self, id):
        self.id = id

SESSION.prepare_datapack(TestData)

test = TestData(777000)
test.name = "Telegram"
SESSION.commit(test)

Installation

You can install this library by using standard pip command.

pip install TelegramDB

Requirements

  • Python 3.8 or higher
  • A telegram client

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update examples as appropriate.

License

GPLv3
Licensed Under GNU General Public License v3

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

TelegramDB-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

TelegramDB-0.1.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file TelegramDB-0.1.0.tar.gz.

File metadata

  • Download URL: TelegramDB-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for TelegramDB-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f4b7bd20749e8900f65a6da3a8d39ad57ffee644d188691559df1f53992b1ea8
MD5 55f3a629e08791be3385fd24e9afa0d2
BLAKE2b-256 2c5f23ddb3baaf2ecceb9730b7b4722b7e17e9ab934686f6372ef06121ff0453

See more details on using hashes here.

File details

Details for the file TelegramDB-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: TelegramDB-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for TelegramDB-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1658f7056f396a78d6f7c126258becb505687df02c655114a702c971c88357d
MD5 27cbc85d191e5ff6dcad515dbf547274
BLAKE2b-256 d54fe926ae2fdcade80cd052d08210b52649bf9d057fe7ab266549d484d0ace4

See more details on using hashes here.

Supported by

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