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.
๐ฏ 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
- Start monitoring: Run
smartpastein your terminal - Copy anything: URLs, text, numbers with units - SmartPaste handles it all
- 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
- 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": "..."
}
- Register it in
smartpaste/handlers/__init__.py - Add configuration options to
config.example.yaml - 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
- ๐ง Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐ Documentation: Wiki
๐ 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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12061a56ee1b074076d0cac7fb69a47948f6db0eb235f3f593ca9cb6de40f3d7
|
|
| MD5 |
28f7578ed7d2116495d4aef9bc631ed0
|
|
| BLAKE2b-256 |
ab0ae15b2f8d0d8ee2a1e0c12095d0f57012e13cad9cef2525583b2562304200
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16cc67aca4191de8b5186af02c1737a88b258c9213b1d5b469c8dcf384b1557c
|
|
| MD5 |
9167755d63ae4c4c890eba593780d1ef
|
|
| BLAKE2b-256 |
a54eba3f2e727cb2c904846d56512ed8f62aa4040a868cce35153d0d45b1f876
|