Skip to main content

Modern asynchronous Telegram bot framework

Project description

Surfgram

Surfgram Logo
PyPI Version Python 3.8+ Telegram Bot API 9.0+ MIT License

Overview

Surfgram is a high-level, object-oriented framework for building scalable Telegram bots with minimal boilerplate. It's designed for developers who want a clean architecture without sacrificing flexibility.

Key Features

  • ✅ Pure OOP – Classes and dependency injection
  • ✅ Fast Setup – Get a bot running in under 20 lines of code
  • ✅ Extensible – Add custom handlers, filters, and database integrations
  • ✅ Async-Ready – Built with asyncio for high performance
  • ✅ Full support for Telegram Bot API 9.0+

Quick Start

  1. Install using PIP:

    pip install surfgram
    
  2. Create your first bot:

    surfgram new mybot
    cd mybot
    surfgram run
    

Example bot's handler

from surfgram import APIObject, Bot
from surfgram.types import BotCommand
from typing import Callable, List

class StartCommand(BotCommand):
    @property
    def __names__(self) -> List[str]:
        return ["start"]

    @property
    def __callback__(self) -> Callable:
        return self.handle

    async def handle(
        self,
        update: APIObject,
        bot: Bot
    ) -> None:
        await bot.send_message(
            chat_id=update.message.chat.id,
            text="Hello, world!"
        )

Documentation

📖 Full documentation
📚 Examples

Contributing

We welcome contributions! Please read our Contributing Guidelines for more information on how to get started.

Support

🐞 Report a bug
💡 Start a discussion
📮 Join our Telegram Channel

License

MIT License. See LICENSE for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

surfgram-0.7.6.tar.gz (66.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

surfgram-0.7.6-py3-none-any.whl (453.5 kB view details)

Uploaded Python 3

File details

Details for the file surfgram-0.7.6.tar.gz.

File metadata

  • Download URL: surfgram-0.7.6.tar.gz
  • Upload date:
  • Size: 66.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.6 Windows/11

File hashes

Hashes for surfgram-0.7.6.tar.gz
Algorithm Hash digest
SHA256 e3c9f33900fe67e1aa7258a45c324578d8d59cdac8f05f287fdcdef96bd8ce89
MD5 e4f3ebbb58ff91793a4be6eaf5e377b9
BLAKE2b-256 215d7673deb301a8b60c8ae0b6c6c923f6ac84aadbd6c4d4035a81d829ce4abf

See more details on using hashes here.

File details

Details for the file surfgram-0.7.6-py3-none-any.whl.

File metadata

  • Download URL: surfgram-0.7.6-py3-none-any.whl
  • Upload date:
  • Size: 453.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.6 Windows/11

File hashes

Hashes for surfgram-0.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b6fa655550d0c17c17da4a09c506ed103f3e76db420ccf2aee2917f8f632365e
MD5 12d3b08468a15d7ef2bc58d1ba7fc06c
BLAKE2b-256 d56b555de38bbb811577df1ea84d8a6ded3c1e5b4883f72f73739677182a1383

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page