replyowl
Email reply body generator for HTML and text in Python
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.
Installation
pip install replyowl
Usage
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>
Project template
This project is generated and maintained with copier-python.
Release files for replyowl 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| replyowl-0.2.3.tar.gz | 13.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| replyowl-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.5 kB
Release files / replyowl-0.2.3.tar.gz
| Download URL | replyowl-0.2.3.tar.gz |
|---|---|
| Size | 13.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8700f40c8c0a9cd80789b883c09a66ae0cdddfc0085bacdca22c355d9854d196
|
|
BLAKE2b-256 checksum How to use checksums |
7e7a2e5ec0b790619ce0f9501de9f48c8228363531720e196c6e1fd3e1ea84f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 22, 2026.
Transparency logRelease files / replyowl-0.2.3-py3-none-any.whl
| Download URL | replyowl-0.2.3-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f450c6797cfa0deaf9fc7bf58aa08784d14b8c2b27ee870f5cbc222b139e0eee
|
|
BLAKE2b-256 checksum How to use checksums |
f6e235b1fb23ef9911543d4126427a9fb37b7bbaf99d8574ac643c834c02f592
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 22, 2026.
Transparency log