Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
replyowl creates email bodies with quoted messages. Provide the original message and your reply message, and replyowl will combine them into a new message. The returned content can be used as the text and/or HTML body content of a new email. HTML-to-text conversion is performed with html2text.
replyowl is available on PyPI:
pip install replyowl
from replyowl import ReplyOwl
owl = ReplyOwl()
text, html = owl.compose_reply(
content="<i>New</i> reply <b>content</b>",
quote_attribution="You wrote:",
quote_text="Original message text",
quote_html="<b>Original</b> message text",
)
print(text)
# _New_ reply **content**
#
# ----
#
# You wrote:
#
# > Original message text
print(html) # (output formatted for readability)
# <!DOCTYPE html>
# <html>
# <head>
# <title></title>
# </head>
# <body>
# <i>New</i> reply <b>content</b>
# <div>You wrote:<br />
# </div>
# <blockquote style="margin-left: 0.8ex; padding-left: 2ex;
# border-left: 2px solid #aaa; border-radius: 8px;" type="cite">
# <b>Original</b> message text
# </blockquote>
# </body>
# </html>
Links in HTML are preserved when creating plain text email bodies:
from replyowl import ReplyOwl
owl = ReplyOwl()
text, html = owl.compose_reply(
content=(
'Check <a href="https://example.com/">this</a> out<br />'
'Or this: <a href="https://example.net/">https://example.net/</a>'
),
quote_attribution="You wrote:",
quote_text="Send me a URL",
quote_html="Send me a <i>URL</i>",
)
print(text)
# Check this (https://example.com/) out
# Or this: https://example.net/
#
# ----
#
# You wrote:
#
# > Send me a URL
If the quoted HTML content contains a <body>
tag, that is preserved:
from replyowl import ReplyOwl
owl = ReplyOwl()
text, html = owl.compose_reply(
content="Hello there",
quote_attribution="You wrote:",
quote_text="Hi",
quote_html='<html><body class="sender_body"><b>Hi</b></body></html>',
)
print(html) # (output formatted for readability)
# <html>
# <body class="sender_body">
# Hello there
# <div>
# You wrote:<br/>
# </div>
# <blockquote style="margin-left: 0.8ex; padding-left: 2ex;
# border-left: 2px solid #aaa; border-radius: 8px;" type="cite">
# <b>Hi</b>
# </blockquote>
# </body>
# </html>
A custom value can be provided for the <blockquote>
's style
tag:
from replyowl import ReplyOwl
owl = ReplyOwl(blockquote_style="font-weight: bold;")
text, html = owl.compose_reply(
text, html = owl.compose_reply(
content="Your quote is in bold",
quote_attribution="You wrote:",
quote_text="I'm going to be in bold when you reply",
quote_html="I'm going to be in bold when you reply",
)
)
print(html) # (output formatted for readability)
# <html>
# <body class="sender_body">
# Your quote is in bold
# <div>
# You wrote:<br/>
# </div>
# <blockquote style="font-weight: bold;" type="cite"
# I'm going to be in bold when you reply
# </blockquote>
# </body>
# </html>
Via pipx
:
pip install pipx
pipx install poetry
pipx inject poetry poetry-dynamic-versioning poetry-pre-commit-plugin
Via pip
:
pip install poetry
poetry self add poetry-dynamic-versioning poetry-pre-commit-plugin
poetry install
poetry run poe lint
or
poetry run pre-commit run --all-files
poetry run poe test
Created from smkent/cookie-python using cookiecutter
FAQs
Email reply body generator for HTML and text
We found that replyowl demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.