Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Posts your html to blogging service

Project description

Build Status

Python html to poster

Simple python function to post plain html text to allows <a>, <blockquote>, <br>, <em>, <figure>, <h3>, <h4>, <img>, <p>, <strong>, elements. It also supports embedded youtube and vimeo iframe tags.

About telegram service


  • lxml
  • requests
  • requests_toolbelt


pip install html-telegraph-poster


>>> from html_telegraph_poster import TelegraphPoster
>>> t = TelegraphPoster(use_api=True)
>>> t.create_api_token('Elon Musk', 'Elon', '') # second and third params are optional
{'access_token': '9f3bab568f*************', 'auth_url': '***********', 'author_name': 'Elon', 'short_name': 'Elon Musk', 'author_url': ''}
>>>'Just another funny joke', author='by me', text='<blockquote>Really hard way</blockquote>')
{'path': 'Just-another-funny-joke-06-05-4', 'url': ''}

# We can modify this article later
>>> t.edit(text=t.text + '<p>some text at the end</p>')
{'path': 'Just-another-funny-joke-06-05-4', 'url': ''}

# Modify page created earlier
>>> t.edit(text="<p>new text</p>", path='/Another-one-page-06-05')
{'path': 'Another-one-page-06-05', 'url': ''}

Generate persistent access token

Actually it's a good idea to generate access token and put it inside environment variables. This command will generate .env file or append TELEGRAPH_ACCESS_TOKEN at the end of it. Note: script will not set environment variable. You can use python-dotenv, set it manually or hardcode it when call TelegraphPoster(access_token='access_token_string')

python -m html_telegraph_poster.create_account "Elon Musk" "Elon" ""

Uploading images

from html_telegraph_poster.upload_images import upload_image

# upload file

#upload url

Project details

Download files

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

Files for html-telegraph-poster, version 0.2.22
Filename, size File type Python version Upload date Hashes
Filename, size html_telegraph_poster-0.2.22-py3-none-any.whl (13.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size html_telegraph_poster-0.2.22.tar.gz (12.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page