Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install the project
run: uv sync --all-extras --dev

- name: Install emailer-lib
- name: Install nbmail
run: uv pip install -e .

# quarto docs build ----
Expand All @@ -57,7 +57,7 @@ jobs:
with:
source-dir: docs/_site

test-emailer-lib:
test-nbmail:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -80,19 +80,19 @@ jobs:
- name: Install the project
run: uv sync --all-extras --dev

- name: Install emailer-lib
- name: Install nbmail
run: uv pip install -e .

- name: Install the project deps
run: uv pip install -e .[dev]

- name: Test emailer-lib
- name: Test nbmail
run: |
uv run pytest emailer_lib/tests/ --cov=emailer_lib --cov-report=xml --cov-report=term-missing
uv run pytest nbmail/tests/ --cov=nbmail --cov-report=xml --cov-report=term-missing

- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: ${{ matrix.python-version == '3.12' }}
with:
file: emailer-lib/coverage.xml
flags: emailer-lib
file: nbmail/coverage.xml
flags: nbmail
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ preview:
cd docs && quarto preview

test:
pytest emailer_lib/tests emailer_lib/mjml/tests --cov-report=xml
pytest nbmail/tests nbmail/mjml/tests --cov-report=xml

test-update:
pytest emailer_lib/tests emailer_lib/mjml/tests --snapshot-update
pytest nbmail/tests nbmail/mjml/tests --snapshot-update

generate-mjml-tags:
python3 emailer_lib/mjml/scripts/generate_tags.py
python3 nbmail/mjml/scripts/generate_tags.py
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# emailer-lib
# nbmail

<!-- [![Python Versions](https://img.shields.io/pypi/pyversions/gt_extras.svg)](https://pypi.python.org/pypi/gt-extras) -->
<!-- [![PyPI](https://img.shields.io/pypi/v/gt-extras?logo=python&logoColor=white&color=orange)](https://pypi.org/project/gt-extras/) -->
Expand All @@ -11,40 +11,40 @@
<!-- [![Contributors](https://img.shields.io/github/contributors/posit-dev/gt-extras)](https://github.com/posit-dev/gt-extras/graphs/contributors) -->
<!-- [![Codecov](https://codecov.io/gh/posit-dev/gt-extras/branch/main/graph/badge.svg)](https://codecov.io/gh/posit-dev/gt-extras) -->

> ⚠️ **emailer-lib is currently in development, expect breaking changes.**
> ⚠️ **nbmail is currently in development, expect breaking changes.**


### What is [emailer-lib](https://posit-dev.github.io/email-for-data-science/reference/)?
### What is [nbmail](https://posit-dev.github.io/email-for-data-science/reference/)?

**emailer-lib** is a Python package for serializing, previewing, and sending email messages in a consistent, simple structure. It provides utilities to convert emails from different sources (Redmail, Yagmail, MJML, Quarto JSON) into a unified intermediate format, and send them via multiple backends (Gmail, SMTP, Mailgun, etc.).
**nbmail** is a Python package for serializing, previewing, and sending email messages in a consistent, simple structure. It provides utilities to convert emails from different sources (Redmail, Yagmail, MJML, Quarto JSON) into a unified intermediate format, and send them via multiple backends (Gmail, SMTP, Mailgun, etc.).

The package is designed for data science workflows and Quarto projects, making it easy to generate, preview, and deliver rich email content programmatically.

<!-- ## Installation
Install the latest release from your local repo or PyPI:

```bash
pip install -e ./emailer-lib
pip install -e ./nbmail
```
-->

## Example Usage

```python
from emailer_lib import (
quarto_json_to_intermediate_email,
IntermediateEmail,
send_intermediate_email_with_gmail,
from nbmail import (
quarto_json_to_email,
Email,
send_email_with_gmail,
)

# Read a Quarto email JSON file
email_struct = quarto_json_to_intermediate_email("email.json")
email_struct = quarto_json_to_email("email.json")

# Preview the email as HTML
email_struct.write_preview_email("preview.html")

# Send the email via Gmail
send_intermediate_email_with_gmail("your_email@gmail.com", "your_password", email_struct)
send_email_with_gmail("your_email@gmail.com", "your_password", email_struct)
```

## Features
Expand Down Expand Up @@ -81,4 +81,4 @@ url = {https://github.com/posit-dev/gt-extras}, version = {0.0.1}
}
``` -->

For more information, see the [docs](https://posit-dev.github.io/email-for-data-science/reference) or [open an issue](https://github.com/posit-dev/email-for-data-science/issues) with questions or suggestions!
For more information, see the [docs](https://posit-dev.github.io/email-for-data-science/reference) or [open an issue](https://github.com/posit-dev/email-for-data-science/issues) with questions or suggestions!
32 changes: 16 additions & 16 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ website:
- orchestrating-tests.qmd

quartodoc:
package: emailer_lib
package: nbmail
dir: reference
title: API Reference
css: reference/_styles-quartodoc.css
Expand All @@ -43,31 +43,31 @@ quartodoc:
An email object that in a serializable, previewable format,
optimized for emails with content generated by data scientists.
contents:
- name: IntermediateEmail
- name: Email
children: separate
- name: IntermediateEmail.write_preview_email
- name: IntermediateEmail.write_email_message
- name: IntermediateEmail.preview_send_email
- name: Email.write_preview_email
- name: Email.write_email_message
- name: Email.preview_send_email
- title: Uploading emails
desc: >
Converting emails to IntermediateEmails,
Converting emails to Emails,
at which point they can be previewed, tested, and sent.
contents:
- quarto_json_to_intermediate_email
- mjml_to_intermediate_email
- redmail_to_intermediate_email
- yagmail_to_intermediate_email
- quarto_json_to_email
- mjml_to_email
- redmail_to_email
- yagmail_to_email

- title: Sending
desc: >
Functions to sending emails with different providers.
And a special handy one to bypass the intermediate object if you are sending a quarto email.
contents:
- send_intermediate_email_with_gmail
- send_intermediate_email_with_smtp
- send_intermediate_email_with_redmail
- send_intermediate_email_with_yagmail
- send_intermediate_email_with_mailgun
- send_email_with_gmail
- send_email_with_smtp
- send_email_with_redmail
- send_email_with_yagmail
- send_email_with_mailgun
- send_quarto_email_with_gmail

- title: Utilities
Expand All @@ -79,7 +79,7 @@ quartodoc:
- title: MJML Authoring
desc: >
Write responsive emails with MJML
package: emailer_lib
package: nbmail
contents:
- mjml.mjml
- mjml.head
Expand Down
2 changes: 1 addition & 1 deletion docs/objects.json

Large diffs are not rendered by default.

Loading