Generate (or write) and send emails using an LLM
Project description
Email sender
This is a python lib to send mail. The mail can be generated by a llm with ollama or you can write it.
Prerequisites
You'll need:
- linux (ubuntu works perfectly)
- an email (gmail, it's only work on gmail for the moment)
- application password (can be create in the gmail account)
- python (works on 3.12.3)
Installation
chmod 755 ./init.sh
./init.sh
Run the program
./run.sh
Usage examples
Example 1: generating the mail
mail = Mail(prompt, model)
mail.set_context(prompt, subject)
mail.set_sender(sender, password)
mail.set_recipient(recipient)
mail.generate()
Example 2: manualy writing
mail = Mail(prompt, model)
mail.set_sender(sender, password)
mail.set_recipient(recipient)
mail.set_subject(subject)
mail.set_body(body)
Example 3: editing the subject or the body
The mail can be send, but after the preview, you want to edit the mail (body and/or subject)
mail = Mail(prompt, model)
# ... generated or wrote
mail.set_subject(subject)
mail.set_body(body)
The class
- The constructor
You'll need:
- prompt: the prompt for the llm
- model: the model of the llm
variable = Mail(prompt, model)
The sets methods
- Set recipient
You'll need:
- recipient: the email to send the mail
variable.set_recipient(recipient)
- Set sender
You'll need:
- sender: the email to send the mail
- password: the application password
variable.set_sender(sender, password)
- Set context
You'll need:
- context: approximatly the idea for the body
- mail_subject: approximatly the idea for the subject
variable.set_context(context, mail_subject)
Generate ,preview and send methods
- Generate
You'll need:
- use the set method to give to the variable the informations to generate the mail
variable.generate()
- Preview
You'll need:
- use the genate method or use the set_subject and set_body methods if you don't want to generate
variable.preview()
- Send
You'll need:
- use the genate method or use the set_subject and set_body methods if you don't want to generate
variable.send()
Other set methods
- Set body
You'll need:
- body: the body of the mail
variable.set_body(body)
- Set subject
You'll need:
- subject: the subject of the mail
variable.set_subject(subject)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lau_project_mail-0.1.0.tar.gz.
File metadata
- Download URL: lau_project_mail-0.1.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7938a43a6c24bc7e2eceb750a56151502fdaa0848586ff25e253f92dc6badc55
|
|
| MD5 |
a8d78abc22daf190a993e6f621235894
|
|
| BLAKE2b-256 |
9207d57e93b7df95dd2148a5ae7250e32982ba5763514962e78aafb39605b9e9
|
Provenance
The following attestation bundles were made for lau_project_mail-0.1.0.tar.gz:
Publisher:
python-publish.yml on LAU-Project/Email-sender
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lau_project_mail-0.1.0.tar.gz -
Subject digest:
7938a43a6c24bc7e2eceb750a56151502fdaa0848586ff25e253f92dc6badc55 - Sigstore transparency entry: 2172696996
- Sigstore integration time:
-
Permalink:
LAU-Project/Email-sender@c3f4b2d7cc7c0430a88597d0bf36cb4f1bab9bef -
Branch / Tag:
refs/tags/Python - Owner: https://github.com/LAU-Project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c3f4b2d7cc7c0430a88597d0bf36cb4f1bab9bef -
Trigger Event:
release
-
Statement type:
File details
Details for the file lau_project_mail-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lau_project_mail-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf59d07e79e8b8c07e908457bb41bd740d6add9474820e7683e92d9091fca59f
|
|
| MD5 |
5ff1d63faad52a96863467727471980c
|
|
| BLAKE2b-256 |
dce92b9b951d334983b4ffe6a8054d1097ec329d994913c9621f9cc2c722adc2
|
Provenance
The following attestation bundles were made for lau_project_mail-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on LAU-Project/Email-sender
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lau_project_mail-0.1.0-py3-none-any.whl -
Subject digest:
cf59d07e79e8b8c07e908457bb41bd740d6add9474820e7683e92d9091fca59f - Sigstore transparency entry: 2172697009
- Sigstore integration time:
-
Permalink:
LAU-Project/Email-sender@c3f4b2d7cc7c0430a88597d0bf36cb4f1bab9bef -
Branch / Tag:
refs/tags/Python - Owner: https://github.com/LAU-Project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c3f4b2d7cc7c0430a88597d0bf36cb4f1bab9bef -
Trigger Event:
release
-
Statement type: