Skip to main content

Python SDK for Telegraph (telegra.ph) API with sync and async support

Project description

TelegrapAPI - Асинхронная и синхронная версия

В чём суть проекта? Да в мире существуют 100-1000 API под Telegraph, но я просто захотел, почему бы и нет?

Features (Особенности)

  1. Синхронный и Асинхронный режим.
  2. Поддержка Pydantic.
  3. Более приятный DX, работа как с ORM

How to Download (Как скачать?)

pip install api-telegraph # Вуаля!

Example (Примеры)

from telegraph_api import Telegraph

with Telegraph() as client:
    account = client.create_account( # Создали аккаунт!
        short_name="GH",
        author_name="GameHipe",
        author_url="https://github.com/game-hipe",
    )

    page = account.create_page(
        title = "Hello World! Start Game!",
        html = "<p>Hello, world!</p>"
    )

    print(page)

AsyncExample (Примеры)

import asyncio

from telegraph_api import AsyncTelegraph

async def main():
    async with AsyncTelegraph() as client:
        account = await client.create_account( # Создали аккаунт!
            short_name="GH",
            author_name="GameHipe",
            author_url="https://github.com/game-hipe",
        )

        await account.create_page(
            title = "Hello World! Start Game!",
            html = "<p>Hello, world!</p>"
        )
        
asyncio.run(main())

Всё идеальное в простом!

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

api_telegraph-1.0.7.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

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

api_telegraph-1.0.7-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file api_telegraph-1.0.7.tar.gz.

File metadata

  • Download URL: api_telegraph-1.0.7.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for api_telegraph-1.0.7.tar.gz
Algorithm Hash digest
SHA256 b858217075fb281a75f8207e8ad7a1ef2a1ddc3f1e0385c859b6b1bac3b5adda
MD5 872cdda7e45ea7bc6f59ca0bd8356c8e
BLAKE2b-256 06c39383ed31422a47d72581790b3918df9cb16f28ef6c81959886101bb98e53

See more details on using hashes here.

File details

Details for the file api_telegraph-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: api_telegraph-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 27.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for api_telegraph-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 da433e04f3eda187765179c487c24721ab6abe99e73fb9d0d74d1343b640d636
MD5 bdb1e9e2f9ac4c942d0956440feceffb
BLAKE2b-256 c702bf40cfe40456229625337f5f33e4585ee12da3e69d88970789ed7cf30f5e

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