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 details)
File details
Details for the file rentrylib-1.0.0.tar.gz
.
File metadata
- Download URL: rentrylib-1.0.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 686923c519bd417d3559b509b0c0f355a823f028d0d8dddee6d9d32be253d249 |
|
MD5 | 79c7982e4fad8663aab0e4b54c5cd795 |
|
BLAKE2b-256 | 0920ad51960c4b7298c75c530face1a5080c300a78c0f3ae66d7814313347630 |