Metadata-Version: 2.1
Name: tgpy
Version: 0.5.0
Summary: Run Python code right in your Telegram messages
Home-page: https://github.com/tm-a-t/TGPy/
License: MIT
Author: tmat
Author-email: a@tmat.me
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: PyYAML (>=6.0,<7.0)
Requires-Dist: aiorun (>=2022.4.1,<2023.0.0)
Requires-Dist: appdirs (>=1.4.4,<2.0.0)
Requires-Dist: cryptg (>=0.3.1,<0.4.0)
Requires-Dist: pydantic (>=1.9.1,<2.0.0)
Requires-Dist: rich (>=12.5.1,<13.0.0)
Requires-Dist: telethon-v1-24 (>=1.24.2,<2.0.0)
Project-URL: Documentation, https://tgpy.tmat.me/
Project-URL: Repository, https://github.com/tm-a-t/TGPy/
Description-Content-Type: text/markdown

# TGPy

_Run Python code right in your Telegram messages_

![PyPI](https://img.shields.io/pypi/v/tgpy)
![Docker Image Version (latest semver)](https://img.shields.io/docker/v/tgpy/tgpy?label=docker&sort=semver)
![Open issues](https://img.shields.io/github/issues-raw/tm-a-t/TGPy)
![Docs](https://img.shields.io/website?label=docs&url=https%3A%2F%2Ftgpy.tmat.me)
<!-- ![PyPI - Downloads](https://img.shields.io/pypi/dm/tgpy) -->

TGPy is a tool for running Python expressions and Telegram API scripts, built on top of [Telethon](https://github.com/LonamiWebs/Telethon).

- Do Python calculations in dialogs
- Use code to send messages, save files, analyze chats and more
- Set up functions to automate your Telegram actions

## Getting started

Python 3.9+ required. Install TGPy and connect it to your Telegram account:

```shell
> pip install tgpy
> tgpy
```

You’re ready now. Send Python code to any chat, and it will run. Change your message to change the result.

Details on installation: http://tgpy.tmat.me/installation/

https://user-images.githubusercontent.com/38432588/181266550-c4640ff1-71f2-4868-ab83-6ea3690c01b6.mp4

## New TGPy docs

**[Basics Guide:](http://tgpy.tmat.me/basics/code/)** All you need to know to start using TGPy.

**[Extensibility Guide:](http://tgpy.tmat.me/extensibility/context/)** Special features for advanced usage.

**[Reference:](http://tgpy.tmat.me/reference/builtins/)** List of TGPy objects and settings.

## Inspiration

TGPy is inspired by [FTG](https://gitlab.com/friendly-telegram/friendly-telegram) and similar userbots. However, the key concept is different: TGPy is totally based on usage of code in Telegram rather than plugging extra modules. This leads both to convenience of single-use scripts and reusage flexibility.

## Credits

TGPy is built on [Telethon](https://github.com/LonamiWebs/Telethon), which allows to integrate Telegram features in Python code.

Basic code transformation (such as auto-return of values) is based on [meval](https://github.com/penn5/meval).

## License

This project is licensed under the terms of the MIT license.

