Skip to main content

A context-aware AI clipboard assistant that enriches content and saves organized markdown files

Project description

SmartPaste ๐Ÿ“‹โœจ

A context-aware AI clipboard assistant that intelligently enriches your clipboard content and organizes it into beautiful markdown files.

License Python Version

๐ŸŽฏ What is SmartPaste?

SmartPaste monitors your clipboard in the background and automatically enriches content with intelligent context:

  • URLs โ†’ Extracts titles, generates summaries, and identifies key topics
  • Numbers with units โ†’ Provides automatic conversions (ยฐC/ยฐF, km/miles, kg/lbs, etc.)
  • Text content โ†’ Detects language, creates summaries, and analyzes content
  • Images โ†’ Extracts text using OCR (optional)
  • Code โ†’ Detects programming languages and provides syntax analysis
  • Email โ†’ Parses email addresses and formats email content
  • Math โ†’ Evaluates mathematical expressions and equations

All processed content is automatically saved to organized daily markdown files, making your clipboard history searchable and useful forever.

๐Ÿš€ Quick Start

Installation

Option 1: Install from PyPI (Recommended)

# Install SmartPaste AI
pip install smartpaste-ai

# Create configuration file
smartpaste --help  # This will show you where to place config.yaml

# Run SmartPaste
smartpaste

Option 2: Install from Source

# Clone the repository
git clone https://github.com/AbdHajjar/smartpaste.git
cd smartpaste

# Install dependencies
pip install -e .

# Copy example configuration
cp config.example.yaml config.yaml

# Run SmartPaste
smartpaste

Basic Usage

  1. Start monitoring: Run smartpaste in your terminal
  2. Copy anything: URLs, text, numbers with units - SmartPaste handles it all
  3. Check your files: Find enriched content in ./smartpaste_data/YYYY-MM-DD.md

โœจ Features

๐ŸŒ URL Enhancement

Input:  https://example.com/article
Output: [Article Title]
        Summary: Brief description of the article content...
        Keywords: technology, innovation, future
        Link: https://example.com/article

๐Ÿ”ข Unit Conversion

Input:  Temperature is 25ยฐC
Output: Temperature is 25ยฐC
        
        Conversions:
        25ยฐC = 77.0 ยฐF, 298.15 K

๐Ÿ“ Text Analysis

Input:  Long article or text content...
Output: [English] TL;DR: Concise summary of the main points...
        
        [Original content follows...]

๐Ÿ–ผ๏ธ OCR Text Extraction (Optional)

Input:  [Image with text]
Output: Image Text: Extracted text from the image using OCR

โš™๏ธ Configuration

SmartPaste is highly configurable. Edit config.yaml to customize:

General Settings

general:
  output_directory: "./smartpaste_data"  # Where to save files
  replace_clipboard: false               # Replace clipboard with enriched content
  check_interval: 0.5                   # Clipboard check frequency (seconds)
  max_content_length: 10000             # Maximum content length to process

Feature Toggles

features:
  url_handler: true      # Enable URL processing
  number_handler: true   # Enable unit conversions
  text_handler: true     # Enable text analysis
  image_handler: false   # Enable OCR (requires pytesseract)

Handler-Specific Settings

url_handler:
  extract_title: true
  generate_summary: true
  extract_keywords: true
  max_keywords: 3
  request_timeout: 10

text_handler:
  detect_language: true
  generate_summary: true
  min_text_length: 50
  supported_languages: ["en", "de", "fr", "es", "it"]

๐Ÿ“ฆ Dependencies

Core Dependencies

  • pyperclip - Clipboard access
  • pyyaml - Configuration management
  • click - Command-line interface
  • requests - Web content fetching
  • beautifulsoup4 - HTML parsing
  • readability-lxml - Content extraction
  • langdetect - Language detection
  • sentence-transformers - Advanced NLP
  • scikit-learn - Machine learning utilities

Optional Dependencies

  • pytesseract - OCR functionality (install with pip install smartpaste-ai[ocr])
  • pillow - Image processing

Development Dependencies

  • pytest - Testing framework
  • black - Code formatting
  • mypy - Type checking
  • flake8 - Linting

๐Ÿ› ๏ธ Development

Setting Up Development Environment

# Clone and install in development mode
git clone https://github.com/AbdHajjar/smartpaste.git
cd smartpaste
pip install -e ".[dev,ocr]"

# Run tests
pytest

# Format code
black .

# Type checking
mypy smartpaste/

# Linting
flake8 smartpaste/

Project Structure

smartpaste/
โ”œโ”€โ”€ smartpaste/           # Main package
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ main.py          # Entry point and main application
โ”‚   โ”œโ”€โ”€ handlers/        # Content type handlers
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ url.py       # URL processing
โ”‚   โ”‚   โ”œโ”€โ”€ number.py    # Unit conversions
โ”‚   โ”‚   โ”œโ”€โ”€ text.py      # Text analysis
โ”‚   โ”‚   โ””โ”€โ”€ image.py     # OCR processing
โ”‚   โ””โ”€โ”€ utils/           # Utility modules
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ io.py        # File I/O operations
โ”‚       โ”œโ”€โ”€ nlp.py       # NLP utilities
โ”‚       โ””โ”€โ”€ timebox.py   # Time/date utilities
โ”œโ”€โ”€ tests/               # Test suite
โ”œโ”€โ”€ pyproject.toml       # Project configuration
โ”œโ”€โ”€ config.example.yaml  # Example configuration
โ””โ”€โ”€ README.md

Running Tests

# Run all tests
pytest

# Run specific test categories
pytest -m unit           # Unit tests only
pytest -m integration    # Integration tests only
pytest -m "not slow"     # Skip slow tests

# Run with coverage
pytest --cov=smartpaste --cov-report=html

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

Adding New Content Handlers

  1. Create a new handler in smartpaste/handlers/:
class MyHandler:
    def __init__(self, config=None):
        self.config = config or {}
    
    def process(self, content):
        # Process content and return enriched result
        return {
            "original_content": content,
            "processed_data": "...",
            "enriched_content": "..."
        }
  1. Register it in smartpaste/handlers/__init__.py
  2. Add configuration options to config.example.yaml
  3. Write tests in tests/test_myhandler.py

Improvement Ideas

  • New content types: Code snippets, mathematical formulas, geographic coordinates
  • Export formats: HTML, PDF, JSON exports
  • Cloud integration: Sync with Google Drive, Dropbox, etc.
  • AI enhancements: Better summarization, sentiment analysis, topic modeling
  • Performance: Background processing, caching, indexing

๐Ÿ“‹ Roadmap

Version 0.2 (Next Release)

  • Improved text summarization with transformer models
  • Plugin system for custom handlers
  • Web dashboard for browsing clipboard history
  • Export functionality (HTML, PDF)

Version 0.3 (Future)

  • Cloud synchronization
  • Mobile companion app
  • Advanced search and filtering
  • Custom AI model integration

Version 1.0 (Stable)

  • Full Windows/macOS/Linux support
  • Installer packages
  • Professional documentation
  • Performance optimizations

๐Ÿ”ง System Requirements

  • Python: 3.10 or higher
  • Operating System: Windows, macOS, Linux
  • Memory: 256MB RAM minimum
  • Storage: 50MB disk space
  • Optional: Tesseract OCR for image text extraction

๐Ÿ“š Examples

Example Output File (2024-01-15.md)

# SmartPaste - 2024-01-15

Auto-generated clipboard content analysis.

---

## 14:32:15 - url

**Source:** clipboard

**Title:** Revolutionary AI Breakthrough Announced
**Summary:** Scientists have developed a new AI system that can understand context better than previous models...
**Keywords:** artificial intelligence, breakthrough, technology
**Link:** [https://example.com/ai-news](https://example.com/ai-news)

---

## 14:35:22 - number

**Source:** clipboard

**Original:** 72 ยฐF

**Conversions:**
- 22.22 ยฐC
- 295.37 K

---

## 14:38:45 - text

**Source:** clipboard

**Language:** English
**Summary:** Discussion about the benefits of automation in modern workflows and productivity improvements.
**Word Count:** 284

[Original text content...]

---

๐Ÿ†˜ Troubleshooting

Common Issues

Q: SmartPaste isn't detecting clipboard changes A: Check that no other applications are blocking clipboard access. Try running as administrator (Windows) or granting accessibility permissions (macOS).

Q: OCR isn't working A: Install Tesseract OCR: pip install smartpaste-ai[ocr] and ensure Tesseract is in your system PATH.

Q: Language detection is incorrect A: Language detection works best with longer text samples (50+ characters). Short texts may be misidentified.

Q: Web requests are timing out A: Increase request_timeout in your config.yaml or check your internet connection.

Getting Help

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • readability-lxml for clean content extraction
  • sentence-transformers for advanced NLP capabilities
  • pytesseract for OCR functionality
  • The open-source community for amazing tools and libraries

Made with โค๏ธ by the SmartPaste community

Transform your clipboard into an intelligent knowledge assistant!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smartpaste_ai-1.0.0.tar.gz (55.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smartpaste_ai-1.0.0-py3-none-any.whl (45.1 kB view details)

Uploaded Python 3

File details

Details for the file smartpaste_ai-1.0.0.tar.gz.

File metadata

  • Download URL: smartpaste_ai-1.0.0.tar.gz
  • Upload date:
  • Size: 55.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for smartpaste_ai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 12061a56ee1b074076d0cac7fb69a47948f6db0eb235f3f593ca9cb6de40f3d7
MD5 28f7578ed7d2116495d4aef9bc631ed0
BLAKE2b-256 ab0ae15b2f8d0d8ee2a1e0c12095d0f57012e13cad9cef2525583b2562304200

See more details on using hashes here.

File details

Details for the file smartpaste_ai-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: smartpaste_ai-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 45.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for smartpaste_ai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16cc67aca4191de8b5186af02c1737a88b258c9213b1d5b469c8dcf384b1557c
MD5 9167755d63ae4c4c890eba593780d1ef
BLAKE2b-256 a54eba3f2e727cb2c904846d56512ed8f62aa4040a868cce35153d0d45b1f876

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page