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 Distribution

telegraph_api-1.0.6.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

telegraph_api-1.0.6-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file telegraph_api-1.0.6.tar.gz.

File metadata

  • Download URL: telegraph_api-1.0.6.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for telegraph_api-1.0.6.tar.gz
Algorithm Hash digest
SHA256 98186e493ca8d04cf860e53dcb34230e749b326dd1f4089fac752c7a092d34b0
MD5 da002ecd5584fd92a9f1583fa999b78a
BLAKE2b-256 74f65537987dd66c68b2eee4389d1d1c0f2e13104559adf0fccd573091eb56ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for telegraph_api-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f36dec50301dcc8a6fbe9751e016316bccefa7a75e5b7dd79f3997951cc7d002
MD5 f90d958ad9979b997ce346ea0f213fcd
BLAKE2b-256 9d58285f7360f35d5c1e9433819a9fa95e9c860e89f77d99469c3bcec862e6a1

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