Skip to main content

asynchronous Python Telegra.ph API wrapper

Project description

PyPI PyPi status Travis-CI Codecov MIT License

aiographfix - asynchronous Python Telegra.ph API wrapper, that fix aiograph

Annotations

The Telegraph class (aiographfix.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 aiographfix.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 aiographfix

From sources

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

Usage examples

import asyncio

from aiographfix 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

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

aiographfix-0.2.2.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

aiographfix-0.2.2-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file aiographfix-0.2.2.tar.gz.

File metadata

  • Download URL: aiographfix-0.2.2.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for aiographfix-0.2.2.tar.gz
Algorithm Hash digest
SHA256 9904d3d8640d524cba04d1f3e4e57d2c721a5e3df0a3f2998f4ff6366ab27cb1
MD5 1abae913a62fa854992a5e9a480dc8dc
BLAKE2b-256 796ad959e7e2ace8681c08c2c05a74c954ee0af9d6e1ae5332b3a5499c0fe73a

See more details on using hashes here.

File details

Details for the file aiographfix-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: aiographfix-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for aiographfix-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4891cbbae374efc4a1d4b26fa09e7ff887f8d86b96865920f7861e825462120a
MD5 53c3b81ab32e2285ad836eb3d070aafa
BLAKE2b-256 fdf788b8a479a2cf4473bc4b4c469f468d66f9393d81825c484fd6879018d36d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page