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.
Documentation: telegramdb.readthedocs.io
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
Licensed Under GNU General Public License v3
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
TelegramDB-1.0.0.tar.gz
(6.1 kB
view details)
Built Distribution
File details
Details for the file TelegramDB-1.0.0.tar.gz
.
File metadata
- Download URL: TelegramDB-1.0.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0967768cf0722c424fee7f76044d2f9dad58e831d8b3867a1ac9c7a21579061 |
|
MD5 | 44c53613e2180786f52abbc9532c34f9 |
|
BLAKE2b-256 | 8d4ecf72262d5c8a1bd88abf977b3d4fb30a45eae8ee4dd1e521d5e24f332293 |
File details
Details for the file TelegramDB-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: TelegramDB-1.0.0-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e7f33fdb9fb1cc0484b05fe67acaafe4ec18a3f4bfe2053c2605ab2b73e7f07 |
|
MD5 | 97e48fb476646e1a627d7f02d1d902d8 |
|
BLAKE2b-256 | 08a0917fda3495012c29ee0963363d3b953b8eb3095ce26b722b33dc423b48dd |