A python library for interfacing with the paste-site https://rentry.org
Project description
rentrylib
A python library for interfacing with the paste-site https://rentry.org
Install
From PyPi: python -m pip install rentrylib
From GitHub: python -m pip install git+https://github.com/yntha/rentrylib
Usage
Create a new page with a custom URL and a custom edit code. Note that these are all optional parameters:
page = rentrylib.RentryPage(
text="Hello World! :)",
custom_url='h3LLoW0RLd',
edit_code='h*ll*w*rld'
)
Edit the page:
response = page.edit({
'text': 'Some new content.',
'edit_code': "This shouldn't be used!",
'new_edit_code': 'new password!!',
'new_url': 'anewurl'
})
Delete this page:
response = page.edit({'delete': True})
# or
response = page.delete()
Misc:
# Get the page URL
# str
page_url = page.site
# Get the page `edit_code`
# str
edit_code = page.code
# Fetch the raw content of this page
# str
content = page.raw
# Fetch the content of this page as a PNG image.
# bytes
image = page.png
# Fetch the content of this page as a PDF document.
# bytes
document = page.pdf
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rentrylib-1.0.0.tar.gz
(8.4 kB
view hashes)