https://github.com/AnimeKaizoku/TelegramDB
A library that uses your telegram account as a database.
https://github.com/AnimeKaizoku/TelegramDB
database hacktoberfest telegram
Last synced: 12 months ago
JSON representation
A library that uses your telegram account as a database.
- Host: GitHub
- URL: https://github.com/AnimeKaizoku/TelegramDB
- Owner: AnimeKaizoku
- License: gpl-3.0
- Created: 2022-01-20T08:54:19.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-18T14:58:36.000Z (about 3 years ago)
- Last Synced: 2024-10-04T14:48:29.339Z (over 1 year ago)
- Topics: database, hacktoberfest, telegram
- Language: Python
- Homepage:
- Size: 2.81 MB
- Stars: 100
- Watchers: 4
- Forks: 22
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TelegramDB
A library which uses your telegram account as a database for your projects.
**Documentation**: [telegramdb.readthedocs.io](https://telegramdb.readthedocs.io/)
[](https://pypi.org/project/TelegramDB)
[](https://pypi.org/project/TelegramDB)
[](https://pypistats.org/packages/telegramdb)
[](https://telegramdb.readthedocs.io/en/latest/)
## Basic Usage
```python
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.
```bash
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
[](https://www.gnu.org/licenses/gpl-3.0.en.html)
Licensed Under GNU General Public License v3