Skip to main content

Modernized Asynchronous Telegraph API wrapper (revived fork)

Project description

🚀 Telegraph-Next

Modern, High-Performance Asynchronous Telegraph API Wrapper

PyPI License Stars Python


Quick StartKey FeaturesInstallationBug Report

🌟 Why Telegraph-Next?

Telegraph-Next is a revitalized, async-first wrapper for the Telegra.ph API. We took the robust foundation of the original project and upgraded it for the modern era of high-load Telegram bots and scalable services.

✨ Key Features

  • ⚡ Fully Asynchronous: Built from the ground up on aiohttp for non-blocking performance.
  • 🛡️ Pydantic-Powered: Every response is a validated object. Get full IDE autocompletion and type safety.
  • 🎞️ Smart HTML Middlewares: Automatic YouTube iframe handling and HTML tag filtering out of the box.
  • 🧼 Clean & Fixed: Zero resource leaks, fixed YouTube parsing bugs, and restored missing dependencies.
  • 🧩 Easy Integration: Designed as a drop-in modernization for high-load systems.

📦 Installation

Install the latest version via pip:

pip install telegraph-next

🛠 Quick Start

1. Basic Usage (Classic)

import asyncio
from telegraph import Telegraph

async def main():
    # Initialize the client
    telegraph = Telegraph()
    
    # Create an account
    await telegraph.create_account(short_name='NeonRobot', author_name='Abbasxan')
    
    # Create a new page with HTML content
    page = await telegraph.create_page(
        title='My First Page',
        content_html='<h1>Hello!</h1><p>Created using <b>Telegraph-Next</b>.</p>'
    )
    
    print(f"Page live at: {page.url}")

asyncio.run(main())

2. Using Context Manager (Recommended)

async with Telegraph() as tg:
    await tg.create_account(short_name='NeonRobot')
    page = await tg.create_page('Modern Way', content_html='<i>Seamless!</i>')
    print(page.url)

🚀 Advanced: HTML Middlewares

Telegraph-Next automatically processes your HTML to ensure it matches Telegra.ph's strict rules:

  • Converts YouTube links to supported embeds.
  • Strips unsupported attributes while keeping src and href.
  • Unwraps unsupported tags to preserve content.

🤝 Credits & Support

Developed and maintained by Abbasxan (Neon Group).
Original concept by IvanProgramming.

If you find this project useful, please give it a ⭐ on GitHub!


Licensed under MIT.

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

telegraph_next-1.1.2.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

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

telegraph_next-1.1.2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file telegraph_next-1.1.2.tar.gz.

File metadata

  • Download URL: telegraph_next-1.1.2.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for telegraph_next-1.1.2.tar.gz
Algorithm Hash digest
SHA256 3dee71b175dd7a26a46ea3c88df7cd6d9f11e53bb8039c8b4476e928d720b837
MD5 366b2c7715a5599a9f5dbb2f2889dfac
BLAKE2b-256 d4782344186d3f307aad3f1750a144316d8d57c22c032b4539d638f545b86fb9

See more details on using hashes here.

File details

Details for the file telegraph_next-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: telegraph_next-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for telegraph_next-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 298fdda8d3c68ed1ea69a754772877859b0e124c0be69fa657c7dc6dabe7c4db
MD5 3a92685be446a135e3960aa544fba988
BLAKE2b-256 578fcbc883b840a83edcfebabe24e4f592f38b9b939a5367fe67e3f2c48e3f9d

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