Skip to main content

Asynchronus Python wrapper for telgra.ph API

Project description

TelegraphAPI

Documentation Status Lines of code PyPI wakatime GitHub Repo stars

Asynchronus Python wrapper for telgra.ph API

Installation

Use the package manager pip to install telegraph_api.

pip install telegraph-api

Documentation

You can read documentation of this package on readthedocs

Documentation of original REST api can be found on telegra.ph site

Features

  • Asynchronus
  • HTML2Nodes convertation
  • File uploading
  • Built with Pydantic
  • Documentation is provided

Usage

# Importing required package
from telegraph_api import Telegraph
import asyncio


# Declaring asynchronous function for using await
async def main():
    # Creating new Telegraph object
    telegraph = Telegraph()
    # Creating new account
    await telegraph.create_account("My Favourite Blog", author_name="Ivan")
    # Creating new page
    new_page = await telegraph.create_page(
        "My first Telegraph Post",
        content_html="<p>Hello world!</p>" # Html content can be presented      
    )
    # Printing page url into console
    print(new_page.url)


# Running asynchronous function
asyncio.run(main())

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

I choosed MIT license


Article in my blog about writing this wrapper (On Russian) - https://blog.rteam.club/all/fromegeya2telegram-1/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

telegraph_api-1.0.5-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: telegraph_api-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.5

File hashes

Hashes for telegraph_api-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 31983f96130ac35f435c3f06b7e7d27954de27692947bad73e95b98cdb02cbd4
MD5 e4e09e9ea8b134003a8c7c75ecc2b9f8
BLAKE2b-256 d34fd01a38c0cf52fa91c1f7d94032bcebea8657b7ef8ce6b3512d72eb8305c6

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