
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
inarrator
Advanced tools

pip install inarrator
In the Google Cloud console, enable the Gmail API.

Register your App

.../auth/gmail.readonly scopeCreate "gmail_credentials.json" file:
+ CREATE CREDENTIALS > OAuth client IDDesktop app as application type

gmail_credentials.jsonUse the inarrator
Chat-GPT Example
from inarrator.email import Gmail
from inarrator.summarizer.gpt import GPTModel
gmail = Gmail()
gmail.authenticate(
credentials_path="gmail_credentials.json",
gmail_scope=["https://www.googleapis.com/auth/gmail.readonly"],
)
# https://support.google.com/mail/answer/7190 (You can read more about Gmail Filters)
emails = gmail.get_latest_emails(
gmail_filters="from:(-noreply -no-reply) is:unread -category:social -category:promotions -unsubscribe", #
gmail_max_emails="30",
)
model = GPTModel(model_name = 'gpt-3.5-turbo-16k',api_token = "") # OPENAI_API_KEY
documents = []
for email in emails:
documents.append(email)
print(model.summarize(documents))
Hugging Face Hub Example
from inarrator.email import Gmail
from inarrator.summarizer import HuggingFaceModel
gmail = Gmail()
gmail.authenticate(
credentials_path="gmail_credentials.json",
gmail_scope=["https://www.googleapis.com/auth/gmail.readonly"],
)
emails = gmail.get_latest_emails(
gmail_filters="from:(-noreply -no-reply) is:unread -category:social -category:promotions -unsubscribe",
gmail_max_emails="30",
)
model = HuggingFaceModel(model_name="tuner007/pegasus_summarizer", api_token="") # HF_HUB_TOKEN
print(model.summarize(emails[0])) # Hugging Face Hub Models currently can summarize one email at a time.
Create a New App Registration

Request API permissions (Only Mail.Read)

Configure the Platform


Create a new client secret
+ New client secret.

outlook_credentials.json. You can get Application (client) ID & Directory (tenant) ID from overview of your App.{"application_id":"Application (client) ID",
"authority_url":"https://login.microsoftonline.com/{Directory (tenant) ID}",
"outlook_scope":["Mail.Read"]}
Since OAuth only work https but our redirect URI is localhost, we would have to make the following environment variable
export OAUTHLIB_INSECURE_TRANSPORT=1
Chat-GPT Example
from inarrator.email import OutLook
from inarrator.summarizer.gpt import GPTModel
outlook = OutLook()
outlook.authenticate(
credentials_path="outlook_credentials.json",
outlook_scope=["Mail.Read"],
)
emails = outlook.get_latest_emails(
outlook_max_emails=5,
)
model = GPTModel(model_name = 'gpt-3.5-turbo-16k',api_token = "") # OPENAI_API_KEY
documents = []
for email in emails:
documents.append(email)
print(model.summarize(documents))
Hugging Face Hub Example
from inarrator.email import OutLook
from inarrator.summarizer.huggingface import HuggingFaceModel
outlook = OutLook()
outlook.authenticate(
credentials_path="outlook_credentials.json",
outlook_scope=["Mail.Read"],
)
emails = outlook.get_latest_emails(
outlook_max_emails=5,
)
model = HuggingFaceModel(model_name="tuner007/pegasus_summarizer", api_token="") # HF_HUB_TOKEN
print(model.summarize(emails[0])) # Hugging Face Hub Models currently can summarize one email at a time.
FAQs
Summarize and Narrate your emails through power of LLMs.
We found that inarrator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.