Save clipboard content (text and images) to files with smart format detection
Project description
ClipDrop
Save clipboard content to files with one command. ClipDrop automatically detects formats (JSON, Markdown, CSV), suggests appropriate extensions, prevents accidental overwrites, and provides rich visual feedback.
๐ Problem We're Solving
The Pain: macOS users face a cumbersome 6-step workflow to save clipboard content:
- Copy content to clipboard
- Open text editor or image application
- Paste content
- Navigate to save location
- Choose file name and format
- Click save
Our Solution: Transform those 6 steps into 1 simple command โ clipdrop filename
This workflow interruption is especially painful for:
- Developers saving code snippets, API responses, or terminal outputs
- Product Managers capturing screenshots and meeting notes
- Content Creators storing drafts, research clips, and visual content
- Students organizing research notes and screenshots
Features
- YouTube Transcripts: Download video transcripts in multiple formats (SRT, VTT, TXT, MD) ๐ฅ
- Web Content Support: Save content from web pages with embedded images ๐
- PDF Creation: Save mixed content (text + images) as PDF to preserve context ๐
- HTML Clipboard Parsing: Automatically extracts text and images from web copies
- Image Support: Save images from clipboard (PNG, JPG, GIF, BMP, WebP) ๐ท
- Smart Format Detection: Automatically detects JSON, Markdown, CSV, PDF, HTML, and image formats
- Extension Auto-Suggestion: No extension? ClipDrop suggests the right one
- Content Priority: Intelligently handles mixed content (HTML โ PDF, text + image โ PDF)
- Safe by Default: Interactive overwrite protection (bypass with
--force) - Paranoid Mode: Optional pre-save secret scan with prompt, redact, block, and warn workflows
- Preview Mode: See content before saving (text with syntax highlighting, images with dimensions)
- Rich CLI: Beautiful, informative output with colors and icons
- Performance: Caches clipboard content for speed (<200ms operations)
- Image Optimization: Automatic compression for PNG/JPEG formats
- Large File Support: Handles files up to 100MB with size warnings
- Unicode Support: Full international character support
- Multi-language Support: YouTube transcripts in 150+ languages with auto-detection
๐ฆ Installation
Quick Install
# Basic installation
pip install clipdrop
# With YouTube transcript support
pip install clipdrop[youtube]
Alternative Installation Methods
# Using uv (fast Python package manager)
uv add clipdrop
# Using pipx (for isolated environments)
pipx install clipdrop
From Source
# Clone the repository
git clone https://github.com/prateekjain24/clipdrop.git
cd clipdrop
# Install with uv
uv pip install -e .
# Or with pip
pip install -e .
Usage
Basic Usage
# Save clipboard to file (auto-detects format)
clipdrop notes # โ notes.txt (text only)
clipdrop screenshot # โ screenshot.png (image only)
clipdrop document # โ document.pdf (mixed content auto-detected)
clipdrop data # โ data.json (if JSON detected)
clipdrop readme # โ readme.md (if Markdown detected)
# Specify extension explicitly
clipdrop report.pdf # Save any content as PDF
clipdrop photo.jpg # Save as JPEG
clipdrop diagram.png # Save as PNG
clipdrop config.yaml # Save as YAML
Options
# Force overwrite without confirmation
clipdrop notes.txt --force
clipdrop notes.txt -f
# Preview content before saving (with syntax highlighting for text, dimensions for images)
clipdrop data.json --preview
clipdrop screenshot.png -P
# Paranoid pre-save secret checks
clipdrop notes.txt -p # prompt on findings
clipdrop secrets.json --paranoid=redact # redact matches then save
clipdrop secrets.txt --paranoid=block # block if secrets found
clipdrop log.txt --paranoid=warn # warn but save as-is
clipdrop env.txt -p --yes # auto-save in non-TTY contexts
clipdrop env.txt --paranoid=prompt --yes # explicit prompt mode with auto-yes
# Force text mode when both image and text are in clipboard
clipdrop notes.txt --text
clipdrop notes.txt -t
# Download YouTube video transcripts
clipdrop --youtube # Download from clipboard URL (defaults to English)
clipdrop --youtube --lang es # Download Spanish captions
clipdrop --youtube transcript.srt # Save as SRT format
clipdrop -yt meeting.txt # Short flag, save as plain text
clipdrop --youtube --chapters notes.md # Include chapter markers in markdown
# Show version
clipdrop --version
# Get help
clipdrop --help
Examples
Save copied text
# Copy some text, then:
clipdrop notes
# โ
Saved 156 B to notes.txt
Save web article with images
# Copy article from Medium, Wikipedia, etc., then:
clipdrop article
# ๐ HTML with images detected. Creating PDF: article.pdf
# โ
Created PDF from HTML (2048 chars, 5 images, 245.3 KB) at article.pdf
Auto-detect JSON and pretty-print
# Copy JSON data, then:
clipdrop config
# ๐ Auto-detected format. Saving as: config.json
# โ
Saved 2.3 KB to config.json
Preview with syntax highlighting
clipdrop script.py --preview
# Shows colored preview with line numbers
# Save this content? [Y/n]:
Save copied image
# Copy an image (screenshot, etc.), then:
clipdrop screenshot
# ๐ท Auto-detected image format. Saving as: screenshot.png
# โ
Saved image (1920x1080, 245.3 KB) to screenshot.png
Handle mixed content
# When both image and text are in clipboard:
clipdrop document # Auto-creates PDF with both (NEW!)
clipdrop content.png # Save image only
clipdrop content --text # Forces text mode
Create PDFs from clipboard
# Mixed content (text + image) โ PDF automatically
clipdrop notes # Has both? โ notes.pdf
# Explicitly create PDF from any content
clipdrop report.pdf # Always creates PDF
# PDF preserves content order (WYCWYG - What You Copy is What You Get)
# โข Text with code โ formatted in PDF
# โข Screenshots โ embedded in PDF
# โข Mixed notes โ structured document
Download YouTube transcripts
# Copy YouTube URL to clipboard, then:
clipdrop --youtube
# ๐ฅ Found YouTube video: dQw4w9WgXcQ
# ๐บ Title: Example Video Title
# โ Selected: English
# โ
Transcript saved to 'Example Video Title.srt'
# Specify language (supports 150+ languages)
clipdrop --youtube --lang fr # French
clipdrop --youtube --lang es # Spanish
clipdrop --youtube --lang ja # Japanese
# Different output formats
clipdrop --youtube video.txt # Plain text
clipdrop --youtube video.srt # SRT subtitles
clipdrop --youtube video.vtt # WebVTT format
clipdrop --youtube video.md # Markdown with timestamps
# Advanced options
clipdrop --youtube --chapters video.md # Include chapter markers
clipdrop --youtube --lang en-US # Specific language variant
๐ง Development
Setup Development Environment
# Clone the repository
git clone https://github.com/prateekjain24/clipdrop.git
cd clipdrop
# Install with dev dependencies
uv pip install -e .[dev]
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov --cov-report=term-missing
# Run specific test file
pytest tests/test_clipboard.py
Code Quality
# Format code
black src tests
# Lint code
ruff check .
# Type checking (if using mypy)
mypy src
Project Status
Completed Features (Sprints 1-3) โ
- Project setup with uv package manager
- CLI skeleton with Typer
- Clipboard text and image reading with caching
- File writing with atomic operations
- Extension detection for text and image formats
- Overwrite protection
- Rich success/error messages
- JSON, Markdown, CSV format detection
- Path validation and sanitization
- Image clipboard support (PNG, JPG, GIF, BMP, WebP)
- Content priority logic (image > text, with --text override)
- Image optimization with format-specific compression
- Comprehensive test suite (89 tests)
- Preview mode with syntax highlighting (text) and dimensions (images)
Enhanced Features ๐
- Custom exception hierarchy for better error handling
- Advanced clipboard operations (stats, monitoring, binary detection, images)
- Enhanced file operations (atomic writes, backups, compression)
- Image format conversion (RGBAโRGB for JPEG)
- Performance optimizations with content caching
- Smart format detection for images and text
Future Roadmap (Sprint 4) ๐ง
- PyPI package release
- Performance profiling for large files
- Cross-platform support (Windows, Linux)
- Configuration file support
๐๏ธ Architecture
clipdrop/
โโโ src/clipdrop/
โ โโโ __init__.py # Version management
โ โโโ main.py # CLI entry point
โ โโโ clipboard.py # Clipboard operations (text + images)
โ โโโ files.py # File operations
โ โโโ images.py # Image-specific operations
โ โโโ detect.py # Format detection
โ โโโ pdf.py # PDF creation (NEW)
โ โโโ exceptions.py # Custom exceptions
โโโ tests/ # Comprehensive test suite (124 tests)
โ โโโ test_clipboard.py # 27 tests
โ โโโ test_files.py # 37 tests
โ โโโ test_images.py # 25 tests
โ โโโ test_pdf.py # 35 tests (NEW)
โโโ pyproject.toml # Modern Python packaging
โโโ README.md # This file
๐ Requirements
- Python: 3.10, 3.11, 3.12, or 3.13
- OS: macOS 10.15+ (initial target)
- Dependencies:
- typer[all] >= 0.17.4
- rich >= 14.1.0
- pyperclip >= 1.9.0
- Pillow >= 11.3.0
- reportlab >= 4.0.0
๐ License
MIT License - See LICENSE file for details.
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Issues
Found a bug or have a feature request? Please open an issue on GitHub Issues.
Current Version: 0.50 | Status: Available on PyPI
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 clipdrop-0.50.tar.gz.
File metadata
- Download URL: clipdrop-0.50.tar.gz
- Upload date:
- Size: 81.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52e116658b21f5c36c5fe95cf19f0c42f6e6a0abae3b2026e02d688635111765
|
|
| MD5 |
78a51c4577224552380b3bea7baf9427
|
|
| BLAKE2b-256 |
533e2eae5f0230fbce2478d3e64e95ad106db27458232034976e3dc685b46d31
|
File details
Details for the file clipdrop-0.50-py3-none-any.whl.
File metadata
- Download URL: clipdrop-0.50-py3-none-any.whl
- Upload date:
- Size: 52.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d565eb1fdf9c49129bd5e8f36fff5d0ff84c25dc2af55760742246ec55c79159
|
|
| MD5 |
103c83e7f207c2252e22922e5222e270
|
|
| BLAKE2b-256 |
2cc9f15ebdae2a3b67af1e96fa68d581acabcd23f3b20342dadae1a456c05c0c
|