Giter Club home page Giter Club logo

lkotlarenko / gramma Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 314 KB

Gramma is an innovative Python application that transforms your clipboard into a smart text assistant. Gramma identifies specific command prefixes within your copied text. Upon recognition, it seamlessly interacts with the GROQ API, utilizing tailored prompts to enhance and refine your text. It's easy to change or create new prompts for your needs.

License: MIT License

Python 91.30% Batchfile 3.95% Shell 4.22% VBScript 0.53%
groq groq-ai groq-api groqapi python-script

gramma's Introduction

🌐 Leia a versΓ£o em portuguΓͺs deste arquivo aqui.

Gramma: Transform your CTRL-C / CTRL-V into a Smart Text Assistant

Gramma is an innovative Python app that transforms your clipboard into a smart text assistant. With its advanced clipboard monitoring capabilities, Gramma identifies specific command prefixes within your copied text. Upon recognition, it seamlessly interacts with the GROQ AI API, utilizing tailored prompts to enhance and refine your text. Whether you're looking to correct grammatical errors, condense lengthy articles, or creatively process content in various ways, Gramma is your go-to solution.

Features

  • Dynamic Command Loading: Easily add new commands using a simple GUI interface.
  • Fully Free and Open Source: View and modify anything without any limits.
  • Privacy Focus: Clipboard data is processed ONLY IF a command prefix is detected.
  • Minimalist Design: Lightweight and focused on ease to use.
  • Notifications: Informative notifications.

Requirements

  • Python 3.7+
  • Groq API key (get one for free here)

Installation

  1. Install Python

    Ensure you have the latest version of Python installed. Download it from the official Python website.

  2. Download the Source Code

    Visit the latest release and download the "Source code (zip)" file.

  3. Extract the Zip File

    Extract the contents of the downloaded zip file to a directory of your choice.

  4. Install Dependencies

    For Windows:

    • Open the extracted folder and double-click on install_windows.bat.
    • A terminal window will open and automatically install the required dependencies and create a desktop shortcut for Gramma.

    For Linux/macOS:

    • Open a terminal and navigate to the extracted folder.
    • Run the following command: bash install_linux.sh
    • This will install the required dependencies and create a desktop shortcut for Gramma.

Setup

After installation, run the newly created Gramma shortcut in your desktop, you will find the Gramma icon in your system tray (notification area).

  1. Right-click on the Gramma icon in the system tray.
  2. Select "Setup".
  3. Enter your GROQ API Key (get one for free here).
  4. (Optional) Change the AI Model if desired (see the available ones here).
  5. Click "Save".
  6. Confirm

Gramma is now ready to use!

Usage

  1. Copy text to your clipboard with one of the command prefixes (e.g., !gf Your text here for grammar correction).
  2. Wait for the notification indicating that the text has been processed.
  3. The processed text will be automatically copied back to your clipboard.

Default Commands

Gramma comes with a set of default commands to enhance your text processing experience:

  • !gf - Grammar Fix: Enhances grammar in your text.
  • !sm - Summarize: Generates a succinct summary of the text.
  • !tl - Translate: Translates the provided text.
  • !df - Define: Provides a definition of a given word or expression.

Adding or Editing Commands

Adding new commands or editing existing ones in Gramma is straightforward:

  1. Right-click on the Gramma icon in the system tray.
  2. Select "Edit Commands".
  3. In the "Edit Commands" window, you can:
    • Add a new command: Click the "Add Command" button and enter the command prefix and prompt (the prefix is only two letters that are not in use by other prefixes).
    • Edit an existing command: Modify commands prefix or prompt as desired.
    • Delete a command: Delete any command from the list by clicking on the red "X" button.
  4. Click "Save" to apply the changes.
  5. Confirm

The new or edited commands will be available for use immediately.

How It Works

  1. Clipboard Monitoring: Gramma continuously monitors the clipboard for changes.
  2. Command Detection: It checks if the clipboard text starts with any predefined command prefixes.
  3. API Interaction: Gramma sends the text (excluding the command prefix) to the GROQ AI API with a corresponding custom prompt.
  4. Text Processing: The AI processes the text and returns the modified version.
  5. Clipboard Update: The processed text is copied back to the clipboard.
  6. Notification: A notification is displayed about the successful processing of the text.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

Author

Created by lkotlarenko.

Support Me

If you liked my work and want to support me, you can sponsor me here on GitHub. Your support will enable me to focus more on open-source projects. Those contributions will help me continue to learn, grow, and contribute to the open-source ecosystem πŸ’š.

GitHub Sponsors

License

This project is licensed under the MIT License.

Links

Project Structure

gramma/
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€core/
β”‚   β”‚  β”œβ”€β”€ clipboard_listener.py
β”‚   β”‚  β”œβ”€β”€ command_processor.py
β”‚   β”‚  β”œβ”€β”€ instance_manager.py
β”‚   β”‚  └── tray_icon.py
β”‚   β”‚
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── data_manager.py
β”‚   β”‚
β”‚   β”œβ”€β”€ gui/
β”‚   β”‚   β”œβ”€β”€ base_page.py
β”‚   β”‚   β”œβ”€β”€ edit_commands_page.py
β”‚   β”‚   └── setup_page.py
β”‚   β”‚
β”‚   β”œβ”€β”€ images/
β”‚   β”‚   β”œβ”€β”€ app_icon.ico
β”‚   β”‚   └── tray_icon.png
β”‚   β”‚
β”‚   β”œβ”€β”€ managers/
β”‚   β”‚   └── instance_manager.py
β”‚   β”‚
β”‚   β”œβ”€β”€ utils.py
β”‚   └── config.py
β”‚
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€core/
β”‚   β”‚  └── __init__.py
β”‚   β”‚
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── test_data_manager.py
β”‚   β”‚
β”‚   β”œβ”€β”€ gui/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ edit_commands_page.py
β”‚   β”‚   └── setup_page.py
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── conftest.py
β”‚
β”œβ”€β”€ commands.json
β”œβ”€β”€ gramma.py
β”œβ”€β”€ install_linux.sh
β”œβ”€β”€ install_windows.bat
β”œβ”€β”€ gramma_starter_linux.sh
β”œβ”€β”€ gramma_starter.bat
β”œβ”€β”€ gramma_to_tray_win.vbs
β”œβ”€β”€ LICENSE
β”œβ”€β”€ poetry.lock
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ README.md
β”œβ”€β”€ README_PT-BR.md
└── settings.json

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.