All Projects → aiogram → aiograph

aiogram / aiograph

Licence: MIT license
Asynchronous Python Telegra.ph API wrapper.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to aiograph

rust botnet
Telegraph botnet written in Rust
Stars: ✭ 15 (-70.59%)
Mutual labels:  telegraph
pasting
Publishing tool made in nodejs using deta.
Stars: ✭ 17 (-66.67%)
Mutual labels:  telegraph
Image-UploadBot
Telegram to telegra.ph image uploader bot
Stars: ✭ 44 (-13.73%)
Mutual labels:  telegraph
TelegraphKit
📜 The ultimate solution for showing ad hoc, server-editable web content (FAQs, Tutorials, Privacy Policy, etc.) in your iOS apps
Stars: ✭ 47 (-7.84%)
Mutual labels:  telegraph
html-telegraph-poster
Python html to telegra.ph poster (telegram article service)
Stars: ✭ 75 (+47.06%)
Mutual labels:  telegraph

AIOGraph

PyPI PyPi status Travis-CI Codecov MIT License

aiograph - asynchronous Python Telegra.ph API wrapper.

Annotations

The Telegraph class (aiograph.Telegraph) encapsulates all API calls in a single class. It provides functions such as create_page, get_views and other's methods described at Telegra.ph/api page

All data types stored In the package aiograph.types.

All methods are named following the PEP-8 instructions for example create_account for createAccount method and etc. All API methods are awaitable and can be called only inside Event-loop.

Also if you want to upload the file to Telegra.ph service use upload method from the instance of Telegraph class.

By the end of all actions you will need to close HTTP connections by calling the close() method (is awaitable).

Installation

Using PIP

$ pip install -U aiograph

From sources

$ git clone https://github.com/aiogram/aiograph.git
$ cd aiograph
$ python setup.py install

Usage examples

Basics

import asyncio

from aiograph import Telegraph

loop = asyncio.get_event_loop()
telegraph = Telegraph()


async def main():
    await telegraph.create_account('aiograph-demo')
    page = await telegraph.create_page('Demo', '<p><strong>Hello, world!</strong></p>')
    print('Created page:', page.url)


if __name__ == '__main__':
    try:
        loop.run_until_complete(main())
    except (KeyboardInterrupt, SystemExit):
        pass
    finally:
        loop.run_until_complete(telegraph.close())  # Close the aiohttp.ClientSession

Links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].