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='Abbasxan', 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='Abbasxan')
    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.3.tar.gz (12.7 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.3-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: telegraph_next-1.1.3.tar.gz
  • Upload date:
  • Size: 12.7 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.3.tar.gz
Algorithm Hash digest
SHA256 d1666d3dc3abb8e06c2765461fd29f425f96b2584d0fe71316cafadb0e75e4bd
MD5 1999049fbba4e0a2b985c8bc9885a577
BLAKE2b-256 d518cc4874c10dd15f3311d4780b2d154cdf4d6d27c62db6b96f3bd6865c5413

See more details on using hashes here.

File details

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

File metadata

  • Download URL: telegraph_next-1.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 aa253721a96ad91d9d1fba59853989a36df48bcb9a867b95f6b8be6e2b707920
MD5 c6f3a293bddbf30af65b169c3ce62451
BLAKE2b-256 c4089c83ff10a939e84a36c79ff6a3fde62a7043a03a1d416f872d3405a540d2

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