Skip to main content

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


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)

Uploaded Source

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