|
1 | | -# email-for-data-science |
| 1 | +# emailer-lib |
| 2 | + |
| 3 | +<!-- [](https://pypi.python.org/pypi/gt-extras) --> |
| 4 | +<!-- [](https://pypi.org/project/gt-extras/) --> |
| 5 | +<!-- [](https://pepy.tech/projects/gt-extras) --> |
| 6 | +<!-- [](https://github.com/posit-dev/email-for-data-science/blob/main/LICENSE) --> |
| 7 | + |
| 8 | +<!-- [](https://github.com/posit-dev/gt-extras/actions/workflows/ci_tests.yml) --> |
| 9 | +[](https://posit-dev.github.io/email-for-data-science/reference/) |
| 10 | +<!-- [](https://www.repostatus.org/#wip) --> |
| 11 | +<!-- [](https://github.com/posit-dev/gt-extras/graphs/contributors) --> |
| 12 | +<!-- [](https://codecov.io/gh/posit-dev/gt-extras) --> |
| 13 | + |
| 14 | +> ⚠️ **emailer-lib is currently in development, expect breaking changes.** |
| 15 | +
|
| 16 | + |
| 17 | +### What is [emailer-lib](https://posit-dev.github.io/email-for-data-science/reference/)? |
| 18 | + |
| 19 | +**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.). |
| 20 | + |
| 21 | +The package is designed for data science workflows and Quarto projects, making it easy to generate, preview, and deliver rich email content programmatically. |
| 22 | + |
| 23 | +<!-- ## Installation |
| 24 | +Install the latest release from your local repo or PyPI: |
| 25 | +
|
| 26 | +```bash |
| 27 | +pip install -e ./emailer-lib |
| 28 | +``` |
| 29 | +--> |
| 30 | + |
| 31 | +## Example Usage |
| 32 | + |
| 33 | +```python |
| 34 | +from emailer_lib import ( |
| 35 | + quarto_json_to_intermediate_email, |
| 36 | + IntermediateEmail, |
| 37 | + send_intermediate_email_with_gmail, |
| 38 | +) |
| 39 | + |
| 40 | +# Read a Quarto email JSON file |
| 41 | +email_struct = quarto_json_to_intermediate_email("email.json") |
| 42 | + |
| 43 | +# Preview the email as HTML |
| 44 | +email_struct.write_preview_email("preview.html") |
| 45 | + |
| 46 | +# Send the email via Gmail |
| 47 | +send_intermediate_email_with_gmail( "[email protected]", "your_password", email_struct) |
| 48 | +``` |
| 49 | + |
| 50 | +## Features |
| 51 | + |
| 52 | +- **Unified email structure** for serialization and conversion |
| 53 | +- **Convert** emails from Redmail, Yagmail, MJML, and Quarto JSON |
| 54 | +- **Send** emails via Gmail, SMTP, Mailgun, and more |
| 55 | +- **Preview** emails as HTML files |
| 56 | +- **Support for attachments** (inline and external) |
| 57 | +- **Simple API** for integration in data science and reporting workflows |
| 58 | + |
| 59 | +## Contributing |
| 60 | +If you encounter a bug, have usage questions, or want to share ideas to make this package better, please feel free to file an [issue](https://github.com/posit-dev/email-for-data-science/issues). |
| 61 | + |
| 62 | +<!-- |
| 63 | +## Code of Conduct |
| 64 | +Please note that the **gt-extras** project is released with a [contributor code of conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).<br>By participating in this project you agree to abide by its terms. --> |
| 65 | + |
| 66 | +<!-- ## 📄 License |
| 67 | +
|
| 68 | +**Great Tables** is licensed under the MIT license. |
| 69 | +
|
| 70 | +© Posit Software, PBC. --> |
| 71 | + |
| 72 | +<!-- ## Citation |
| 73 | +If you use **gt-extras** in your work, please cite the package: |
| 74 | +
|
| 75 | +```bibtex |
| 76 | +@software{gt_extras, |
| 77 | +authors = {Jules Walzer-Goldfeld, Michael Chow, and Rich Iannone}, |
| 78 | +license = {MIT}, |
| 79 | +title = {{gt-extras: Extra helpers for great-tables in Python.}}, |
| 80 | +url = {https://github.com/posit-dev/gt-extras}, version = {0.0.1} |
| 81 | +} |
| 82 | +``` --> |
| 83 | + |
| 84 | +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! |
0 commit comments