All Projects → AnimeKaizoku → TelegramDB

AnimeKaizoku / TelegramDB

Licence: GPL-3.0 License
A library that uses your telegram account as a database.

Programming Languages

python
139335 projects - #7 most used programming language
Batchfile
5799 projects

TelegramDB

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

Documentation: telegramdb.readthedocs.io

pypi pyversion downlaods docs

Basic Usage

from os import getenv
from pyrogram import Client
from telegramdb 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.6 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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].