Skip to main content

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.

Metadata

Release files for surfgram 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for surfgram 1.0.1
File Size Uploaded Provenance Actions
surfgram-1.0.1.tar.gz 67.0 kB Without provenance Details for surfgram-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for surfgram 1.0.1
File Interpreter ABI Platform Actions
surfgram-1.0.1-py3-none-any.whl Python 3 none any Details for surfgram-1.0.1-py3-none-any.whl

Total release size: 520.5 kB

Release files / surfgram-1.0.1.tar.gz

Download URL surfgram-1.0.1.tar.gz
Size 67.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2a38ea9f628f50f451f662b699eed140a2bb5995307fde34e0a3cc931dc15ae7
BLAKE2b-256 checksum
How to use checksums
b30929c5ffdc4c02c6de8ed371acbdd606e0d6c468d5fdcb4c04c22cf54de9af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.6 Windows/11

Release files / surfgram-1.0.1-py3-none-any.whl

Download URL surfgram-1.0.1-py3-none-any.whl
Size 453.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7419b76d2ddf4d989dac0b858d59fe58125333a969606d3c39793fe59911ab6
BLAKE2b-256 checksum
How to use checksums
5882283a8d557413979630e2d5998e5d19fd07350a9bd481adcb73aa8eed44c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.6 Windows/11

Security for surfgram 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page