Rocketgram
Modern and powerful asynchronous telegram bot framework.
Release news available here: @RocketgramNews
Dependencies
All dependencies are optional, but you should install aiohttp to use the framework.
orjson or ujson is highly recommended to speed up json parsing.
Also, you can use uvloop as alternative to standard event loop.
How to install
For development
pip install rocketgram[aiohttp]
For production
pip install uvloop rocketgram[aiohttp,orjson]
Example
There is a trivial example below. Here is useful bot template.
from rocketgram import Bot, Dispatcher, UpdatesExecutor
from rocketgram import context, commonfilters
from rocketgram import SendMessage
try:
import uvloop
uvloop.install()
except ImportError:
pass
token = f'YOUR_BOT_TOKEN'
router = Dispatcher()
bot = Bot(token, router=router)
@router.handler
@commonfilters.command('/start')
async def start_command():
await SendMessage(context.user.id, f'Hello there!').send()
@router.handler
@commonfilters.command('/help')
async def start_command():
await SendMessage(context.user.id, f'Some userful help!').send()
UpdatesExecutor.run(bot)
Testing
Code tested automatically using Github Actions.
You can see the build status here.
To test code manually run pytest:
pytest
Metadata
Release files for rocketgram 6.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rocketgram-6.0.4.tar.gz | 72.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rocketgram-6.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 304.4 kB
Release files / rocketgram-6.0.4.tar.gz
| Download URL | rocketgram-6.0.4.tar.gz |
|---|---|
| Size | 72.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc33a7d65883877c31451e3c3486c5a64dbf910923f52b76a67d3216ef27627d
|
|
BLAKE2b-256 checksum How to use checksums |
2111a2006af271b60a41ddd1c0900b71a61dcd20a478e194cad13ab9c82aca9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.13.3 CPython/3.12.2 Linux/6.5.0-1017-azure
|
Release files / rocketgram-6.0.4-py3-none-any.whl
| Download URL | rocketgram-6.0.4-py3-none-any.whl |
|---|---|
| Size | 231.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
be9d5a9529d985cdcc4926567a8e985eead3b2a6094120cbdeb8b2a66e1eac29
|
|
BLAKE2b-256 checksum How to use checksums |
da294824e8b39a4fca408e18a94e2d23b888623b8eec525312a171f33ec54ea9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.13.3 CPython/3.12.2 Linux/6.5.0-1017-azure
|