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 "git+https://github.com/game-hipe/telegraph-api.git" # Вуаля!

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.5.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.5-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for api_telegraph-1.0.5.tar.gz
Algorithm Hash digest
SHA256 2a5fd1f3df20883006fd0bbbc219cf129e1e1cdeee8e63302f239ed9a80fdb15
MD5 18e228dc82ab9173bd68c5b2cbc70365
BLAKE2b-256 02ed6f1aedbc01730d4db9dde274e66f9c3a4473f5768641f05c86a3dbc106b0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for api_telegraph-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 82eb55a2aaa9155c2ec1b7d6052024652f992fc4997c7a19e2011ac55f0bd93f
MD5 d790f615392d87609130e813ebdedaaa
BLAKE2b-256 3e54f831fa129a1456c0a0da64eea54ba251b180b20b57635f6618419f049829

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