TelegraphAPI
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
- Asynchronous
- 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/
Release files for telegraph-api 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| telegraph_api-1.1.0.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| telegraph_api-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.5 kB
Release files / telegraph_api-1.1.0.tar.gz
| Download URL | telegraph_api-1.1.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
402acc36c4f41fa32c3f3327f1a45f113de5ea733a7d1b370f04c16759dd55e4
|
|
BLAKE2b-256 checksum How to use checksums |
50ea865b1b75b38b7b817be86d022ed710490dbe7b9c7e41017af3475a39d145
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Release files / telegraph_api-1.1.0-py3-none-any.whl
| Download URL | telegraph_api-1.1.0-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f2b7dab8542dc55e51dc7eae178647f24d988ebec8cf949e0e373232b216bf4
|
|
BLAKE2b-256 checksum How to use checksums |
0613f31f8265073c0f0b50b9c87032ec910a6a5ecd6c991cc53234ca8f71445c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|