https://github.com/torrua/callbaker
Telegram callback queries converter
https://github.com/torrua/callbaker
callback hacktoberfest python telegram
Last synced: 5 months ago
JSON representation
Telegram callback queries converter
- Host: GitHub
- URL: https://github.com/torrua/callbaker
- Owner: torrua
- License: mit
- Created: 2020-04-09T00:14:50.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-10-27T18:27:11.000Z (8 months ago)
- Last Synced: 2026-01-04T10:56:52.161Z (6 months ago)
- Topics: callback, hacktoberfest, python, telegram
- Language: Python
- Homepage:
- Size: 60.5 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# 👨🍳 callbaker
[](https://pypi.python.org/pypi/callbaker)
[](https://codecov.io/gh/torrua/callbaker)
[](https://github.com/torrua/callbaker/actions/workflows/pytest.yml)
Telegram callback queries converter
Read [this Guide in Russian](README_RU.md) also.
## What it is
This tiny package can help you parse the callback data request response for telegram bots.
## How to install
``pip install callbaker``
## How to use
There are two main functions that might be helpfull for you:
`info_from_callback` get callback string and convert it to dict.
`callback_from_info` combine dict into string prepared for callback.
Examples:
```
result = callback_from_info(info={"k1": "str", "k2": 2, "k3": None, "k4": False, "k5": (1, 2)})
print(result)
```
```"&k1=str&k2=2&k3=None&k4=False&k5=(1, 2)"```
```
result = info_from_callback(call_data="&key_1=value_1&key_2=value_2")
print(result)
```
```{'key_1': 'value_1', 'key_2': 'value_2'}```