Red Box: Advanced Email Box Reader
Next generation email box reader/manager
What is it?
Red Box is an advanced email box reader library. It is a sister library for Red Mail, advanced email sender. It makes managing your email box in Python very easy.
Core features:
- Easy email searching
- Intuitive message manipulation
- Intuitive email box manipulation
Install it from PyPI:
pip install redbox
Why Red Box?
Imaplib from standard library is complex to use and unintuitive. Red Box makes reading email boxes easy.
With Red Box, it is simple as this:
from redbox import EmailBox
# Create an email box instance
box = EmailBox(host="localhost", port=0)
# Select an email folder
inbox = box['INBOX']
# Get emails
emails = inbox.search(
from_="mikael.koli@example.com",
subject="Red Box released",
unseen=True
)
More Examples
There is also a query language for arbitrary search queries:
from redbox.query import FROM, UNSEEN, FLAGGED
emails = inbox.search(
FROM('mikael.koli@example.com') & (UNSEEN | FLAGGED)
)
Red Box also makes reading different parts of the email messages easy:
# Get one email
email = emails[0]
# String representation of the message
print(email.content)
# Email contents
print(email.text_body)
print(email.html_body)
# Email headers
print(email.from_)
print(email.to)
print(email.date)
Here is a complete example:
from redbox import EmailBox
box = EmailBox(host="localhost", port=0)
inbox = box['INBOX']
for msg in inbox.search(subject="example 2", unseen=True):
# Process the message
print(msg.subject)
print(msg.text_body)
# Set the message as read/seen
msg.read()
See more from the documentation.
If the library helped you save time, consider buying a coffee for the maintainer ☕.
Author
- Mikael Koli - Miksus - koli.mikael@gmail.com
Metadata
Release files for redbox 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| redbox-0.2.1.tar.gz | 220.0 kB | Without provenance | Details for redbox-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| redbox-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for redbox-0.2.1-py3-none-any.whl |
Total release size: 236.5 kB
Release files / redbox-0.2.1.tar.gz
| Download URL | redbox-0.2.1.tar.gz |
|---|---|
| Size | 220.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17005f8cfe8acba992b649e5682b2dd4bff937d67df3fd8496e187cae4f19d60
|
|
BLAKE2b-256 checksum How to use checksums |
5b3342dbfd394d8099079d31dc0f98afca62bc6cc9635ea1ccab1029fefdc6ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.10
|
Release files / redbox-0.2.1-py3-none-any.whl
| Download URL | redbox-0.2.1-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
14906668345c7e76db367d6d40347c2dcb5de2a5167f96d08f06f95c0a908f71
|
|
BLAKE2b-256 checksum How to use checksums |
24249f8330b5ce5a64cd97ae2d3a00d1d5cb9096c54ac2e56a05d7a5812709b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.10
|
Security for redbox 0.2.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.