В чём суть проекта? Да в мире существуют 100-1000 API под Telegraph, но я просто захотел, почему бы и нет?
- Синхронный и Асинхронный режим.
- Поддержка Pydantic.
- Более приятный DX, работа как с ORM
pip install "git+https://github.com/game-hipe/telegraph-api.git" # Вуаля!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)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())Ебашьте!