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-0.2.0.tar.gz
(6.4 kB
view details)
Built Distribution
File details
Details for the file TelegramDB-0.2.0.tar.gz
.
File metadata
- Download URL: TelegramDB-0.2.0.tar.gz
- Upload date:
- Size: 6.4 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0625d393998df0dec866e5939f10f2471ebf25fd1438589826cac2d8dc88e632 |
|
MD5 | 2173b3f69cec1912775e1034d569f3f7 |
|
BLAKE2b-256 | 663d18663bee33d095221831fabab345c9f7902dd0f5269a5506188e3406c1bc |
File details
Details for the file TelegramDB-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: TelegramDB-0.2.0-py3-none-any.whl
- Upload date:
- Size: 20.8 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | fac0d838154d2f784783b40b232ccbada65ffe93ccf8327d82d25c3135c5364b |
|
MD5 | c749603c2083a5a9b1b87958047a5601 |
|
BLAKE2b-256 | 0baadf62e1ca7f9eefbffb6cd9971113f859055e9cd4689875b89e9b0abefe53 |