Giter VIP home page Giter VIP logo

tldr's Introduction

TLDR; An Email Summarizer ๐Ÿ“จโœจ

My kid's school sends so many emails, often times with long, flowery prose. I simply don't have time to read and digest all the different communication styles and am driven up the wall by the liberal use of "as already mentioned in a previous email". Seriously?!? You're going to add 7 words in at least 10 e-mails a week that add absolutely zero value? Sheesh.

TLDR; is an email summarizer designed to swiftly process emails, extract pivotal details, and provide crisp, cogent summaries utilizing OpenAI's GPT model. With built-in features to detect events and seamlessly integrate with Gmail, this tool significantly enhances email management efficiency.

๐Ÿš€ Features

  • ๐Ÿ“„ Automatic and coherent summarization of emails.
  • ๐Ÿ“… Real-time event detection from emails, with effortless integration into Google Calendar.
  • ๐Ÿ”„ Rate-limit awareness for efficient OpenAI calls.
  • ๐Ÿงฉ Dynamic text chunking for processing lengthy emails.
  • ๐Ÿ” .env support for secure and hassle-free configuration.
  • ๐ŸŒ Gmail API integration for a complete email processing experience.

๐Ÿ›  Setup & Installation

  1. Clone the Repository:

    git clone https://github.com/markwbrown/TLDR

    Navigate to the cloned directory using:

    cd TLDR
  2. Install Dependencies: Make sure you have pip installed. Then, run:

    pip install -r requirements.txt
  3. Set up a Google Cloud Project:

    • Visit Google Cloud Console.
    • Click the 'Select a project' drop-down, then 'NEW PROJECT', and name it.
    • Follow the prompts to set up the project.
  4. Enable the Gmail API:

    • In the Google Cloud Console, navigate to the Dashboard.
    • Click "ENABLE APIS AND SERVICES".
    • Search for 'Gmail API' and select it.
    • Click the "ENABLE" button.
  5. Set up your Gmail Labels:

    • This project uses two labels: "School" and "SchoolProcessed".
    • Go to your Gmail settings (gear icon > See all settings > Labels tab) and create these labels.
    • To automatically apply the "School" label to incoming emails from your kid's school, set up a filter:
      • In Gmail, go to Settings > Filters and Blocked Addresses > Create a new filter.
      • In the "From" field, input the following: [email protected] OR [email protected] (adjust with actual email addresses you want summarized. I added all the parents too in case somebody decides to reply all).
      • Click 'Create filter' and then:
        • Check 'Skip the Inbox (Archive it)'.
        • Check 'Apply the label' and select "School" from the dropdown.
        • Check 'Never send it to Spam'.
        • Finally, click 'Create filter'.
  6. Create OAuth 2.0 Credentials:

    • Back in the Google Cloud Console, navigate to 'Credentials' under the APIs & Services tab.
    • Click 'Create Credentials' and select 'OAuth 2.0 Client ID'.
    • For Application type, select 'Desktop app' and create.
  7. Download the Credentials JSON File:

    • After creating the OAuth 2.0 credentials, click the download icon (a downward arrow) next to the client ID you created.
    • Save the downloaded file as credentials.json in the root of the TLDR project directory.
  8. Get OpenAI API Key:

    • Go to OpenAI and sign up or sign in.
    • Navigate to the API section to generate or retrieve your API key.
  9. Create a .env File:

    • Make a copy of the .env-sample file provided in the repository:
      cp .env-sample .env
    • Open the .env file with your favorite text editor.
    • Replace YOUR_OPENAI_API_KEY_HERE with your actual OpenAI API key, such that it looks like:
      OPENAI_API_KEY=your_actual_key_here
      
  10. Run the Script:

    python main.py

Now you're all set! This will process emails from the "School" label, summarize them, and then apply the "SchoolProcessed" label after processing. You will be prompted to authorize the script the first time you run it. Follow the prompts to authorize the script and you're good to go!

... Ideally this should be run as a cron job, but you can also run it manually.

๐Ÿค Contribution

Interested in enhancing this tool? Contributions are always welcome! Please fork the repository and use a feature branch for any changes. Once you're ready, open a pull request and let's take it from there.

๐Ÿ“œ License

This project is licensed under the MIT License. Dive into the LICENSE file for more details.

tldr's People

Contributors

markwbrown avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.