pyshotter


Namepyshotter JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryPyShotter: Smart, annotated, and shareable screenshots for Python.
upload_time2025-07-13 21:22:02
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2024-2025, Abdoullah Ndao Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords annotation change detection cross-platform history hotkeys ocr panorama python redaction screen capture screenshot sharing smart detection text extraction
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyShotter

[![PyPI version](https://badge.fury.io/py/pyshotter.svg)](https://badge.fury.io/py/pyshotter)
[![Tests workflow](https://github.com/utachicodes/pyshotter/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/utachicodes/pyshotter/actions/workflows/tests.yml)
[![Downloads](https://static.pepy.tech/personalized-badge/pyshotter?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/pyshotter)

> [!TIP]
> **PyShotter** - Smart, annotated, and shareable screenshots for Python.

```python
from pyshotter import pyshotter

# The simplest use, save a screenshot of the 1st monitor
with pyshotter() as sct:
    sct.shot()
```

An ultra-fast cross-platform screenshot library that makes it easy to capture, annotate, and share screenshots from your Python code.

## Features

### Smart Detection
- **Code Region Detection** - Automatically detect code blocks and windows using computer vision
- **Window Detection** - Smart identification of application windows and UI elements
- **OCR Text Extraction** - Extract text from screenshots using Tesseract OCR engine
- **Content Analysis** - Intelligent analysis of screenshot content for better processing

### Rich Annotation
- **Text Annotations** - Add text with custom fonts, sizes, and colors
- **Shape Drawing** - Rectangles, circles, arrows, and custom geometric shapes
- **Smart Highlighting** - Semi-transparent overlays for emphasis and focus
- **Quick Markup** - One-line annotation commands for rapid screenshot editing
- **Layer Management** - Multiple annotation layers with proper compositing

### Easy Sharing
- **Clipboard Copy** - Copy screenshots directly to system clipboard
- **Shareable Links** - Generate instant shareable URLs for screenshots
- **Cloud Upload** - Upload to cloud services with embedded metadata
- **Cross-Platform** - Works seamlessly on Windows, macOS, and Linux
- **Metadata Support** - Rich metadata embedding for better organization

### Advanced Features
- **Sensitive Data Redaction** - Automatically blur emails, phone numbers, credit cards, and SSNs
- **Multi-Monitor Panorama** - Stitch all monitors into one panoramic image
- **Change Detection** - Highlight changes between screenshots with configurable sensitivity
- **Customizable Hotkeys** - Set global hotkeys for screenshot capture and annotation
- **Screenshot History & Search** - Searchable history with metadata and OCR text indexing
- **High Performance** - Optimized for speed and efficiency using ctypes
- **Thread-Safe** - Safe for multi-threaded applications

## Installation

### Recommended Installation

```shell
python -m pip install -U --user pyshotter
```

### Optional Dependencies

For enhanced features, install additional dependencies:

```shell
# For OCR and advanced image processing
python -m pip install pyshotter[ocr]

# For annotation features
python -m pip install pyshotter[annotation]

# For sharing features
python -m pip install pyshotter[sharing]

# For cloud upload capabilities
python -m pip install pyshotter[cloud]

# For development
python -m pip install pyshotter[dev]
```

## Quick Start

### Basic Screenshot Capture

```python
from pyshotter import pyshotter

# Take a screenshot of the first monitor
with pyshotter() as sct:
    sct.shot()

# Take screenshots of all monitors
with pyshotter() as sct:
    for i, monitor in enumerate(sct.monitors):
        sct.shot(mon=i)
```

### Smart Detection and Analysis

```python
from pyshotter import pyshotter, SmartDetectionFeature, OCRFeature

with pyshotter() as sct:
    screenshot = sct.grab(sct.monitors[0])
    
    # Detect code regions and windows
    detector = SmartDetectionFeature()
    code_regions = detector.detect_code_regions(screenshot)
    windows = detector.detect_windows(screenshot)
    
    print(f"Found {len(code_regions)} code regions")
    print(f"Found {len(windows)} windows")
    
    # Extract text using OCR
    ocr = OCRFeature()
    text = ocr.extract_text(screenshot)
    print(f"Extracted text: {text}")
```

### Rich Annotation

```python
from pyshotter import pyshotter, AnnotationFeature

with pyshotter() as sct:
    screenshot = sct.grab(sct.monitors[0])
    
    # Initialize annotation
    annotator = AnnotationFeature()
    
    # Add text annotation
    annotated = annotator.add_text(
        screenshot, 
        "Important Code Here!", 
        (100, 100),
        font_size=24,
        color=(255, 0, 0)  # Red text
    )
    
    # Add rectangle around a region
    annotated = annotator.add_rectangle(
        annotated,
        (50, 50),      # Top-left corner
        (400, 200),    # Bottom-right corner
        color=(0, 255, 0),  # Green rectangle
        thickness=3
    )
    
    # Add arrow pointing to something
    annotated = annotator.add_arrow(
        annotated,
        (150, 150),    # Start point
        (300, 100),    # End point
        color=(0, 0, 255),  # Blue arrow
        thickness=2
    )
    
    # Add circle highlight
    annotated = annotator.add_circle(
        annotated,
        (200, 150),    # Center point
        30,             # Radius
        color=(255, 255, 0),  # Yellow circle
        thickness=2
    )
    
    # Add highlight overlay
    annotated = annotator.add_highlight(
        annotated,
        (100, 100, 200, 100),  # (x, y, width, height)
        color=(255, 255, 0),    # Yellow highlight
        alpha=0.3               # 30% transparency
    )
    
    # Save the annotated screenshot
    annotated.save("annotated_screenshot.png")
```

### Easy Sharing

```python
from pyshotter import pyshotter, SharingFeature

with pyshotter() as sct:
    screenshot = sct.grab(sct.monitors[0])
    
    # Initialize sharing
    sharer = SharingFeature()
    
    # Copy to clipboard
    if sharer.copy_to_clipboard(screenshot):
        print("Screenshot copied to clipboard!")
    
    # Generate shareable link
    link = sharer.generate_shareable_link(screenshot)
    print(f"Shareable link: {link}")
    
    # Save with metadata
    metadata = {
        "title": "My Screenshot",
        "description": "Screenshot taken with PyShotter",
        "tags": ["python", "screenshot", "demo"],
        "author": "Abdoullah Ndao",
        "timestamp": "2024-12-19"
    }
    
    sharer.save_with_metadata(screenshot, "screenshot.png", metadata)
```

### Sensitive Data Redaction

```python
from pyshotter import pyshotter, RedactionFeature

with pyshotter() as sct:
    screenshot = sct.grab(sct.monitors[0])
    
    # Initialize redaction
    redaction = RedactionFeature()
    
    # Redact sensitive data
    clean_screenshot = redaction.redact_sensitive_data(screenshot)
    clean_screenshot.save("clean_screenshot.png")
```

### Multi-Monitor Panorama

```python
from pyshotter import pyshotter, PanoramaFeature

with pyshotter() as sct:
    # Capture all monitors
    screenshots = []
    for monitor in sct.monitors:
        screenshot = sct.grab(monitor)
        screenshots.append(screenshot)
    
    # Create panoramic image
    panorama = PanoramaFeature()
    panoramic_screenshot = panorama.create_panorama(screenshots)
    panoramic_screenshot.save("panorama.png")
```

### Change Detection

```python
import time
from pyshotter import pyshotter, ChangeDetectionFeature

with pyshotter() as sct:
    # Take first screenshot
    previous = sct.grab(sct.monitors[0])
    
    # Wait for changes
    time.sleep(5)
    
    # Take second screenshot
    current = sct.grab(sct.monitors[0])
    
    # Detect changes
    detector = ChangeDetectionFeature()
    changes = detector.detect_changes(current, previous, threshold=0.1)
    changes.save("changes.png")
```

### Screenshot History and Search

```python
from pyshotter import pyshotter, ScreenshotHistory

# Initialize history manager
history = ScreenshotHistory()

with pyshotter() as sct:
    screenshot = sct.grab(sct.monitors[0])
    
    # Add to history with metadata
    screenshot_id = history.add_screenshot(
        screenshot,
        metadata={
            "tags": ["desktop", "work"],
            "window_title": "Example Window",
            "description": "Sample screenshot for demonstration"
        }
    )
    
    # Search history
    results = history.search_history("work")
    for result in results:
        print(f"Found: {result['id']} - {result['timestamp']}")
```

## API Reference

### Core Functions

#### `pyshotter(**kwargs)`
Factory function that returns a platform-specific screenshot instance.

**Parameters:**
- `mon` (int): Monitor index (default: 0)
- `output` (str): Output filename pattern
- `with_cursor` (bool): Include cursor in screenshot
- `compression_level` (int): PNG compression level (0-9)

**Returns:**
- Platform-specific screenshot instance

#### `sct.shot(**kwargs)`
Take a screenshot and save it to a file.

**Parameters:**
- `mon` (int): Monitor index or monitor dict
- `output` (str): Output filename
- `with_cursor` (bool): Include cursor

**Returns:**
- List of saved filenames

#### `sct.grab(monitor)`
Capture a screenshot without saving.

**Parameters:**
- `monitor` (dict): Monitor configuration

**Returns:**
- ScreenShot object

### Smart Detection Features

#### `SmartDetectionFeature.detect_code_regions(screenshot)`
Detect code-like regions in screenshots.

**Parameters:**
- `screenshot` (ScreenShot): Screenshot to analyze

**Returns:**
- List of dictionaries with bounding boxes and confidence scores

#### `SmartDetectionFeature.detect_windows(screenshot)`
Detect application windows in screenshots.

**Parameters:**
- `screenshot` (ScreenShot): Screenshot to analyze

**Returns:**
- List of dictionaries with window bounding boxes

### Annotation Features

#### `AnnotationFeature.add_text(screenshot, text, position, font_size, color)`
Add text annotation to a screenshot.

**Parameters:**
- `screenshot` (ScreenShot): Screenshot to annotate
- `text` (str): Text to add
- `position` (tuple): (x, y) position
- `font_size` (int): Font size
- `color` (tuple): RGB color tuple

**Returns:**
- Annotated ScreenShot object

#### `AnnotationFeature.add_rectangle(screenshot, top_left, bottom_right, color, thickness)`
Add rectangle annotation to a screenshot.

**Parameters:**
- `screenshot` (ScreenShot): Screenshot to annotate
- `top_left` (tuple): Top-left corner (x, y)
- `bottom_right` (tuple): Bottom-right corner (x, y)
- `color` (tuple): RGB color tuple
- `thickness` (int): Line thickness

**Returns:**
- Annotated ScreenShot object

### Sharing Features

#### `SharingFeature.copy_to_clipboard(screenshot)`
Copy screenshot to system clipboard.

**Parameters:**
- `screenshot` (ScreenShot): Screenshot to copy

**Returns:**
- bool: Success status

#### `SharingFeature.generate_shareable_link(screenshot, service)`
Generate a shareable link for the screenshot.

**Parameters:**
- `screenshot` (ScreenShot): Screenshot to share
- `service` (str): Sharing service name

**Returns:**
- str: Shareable URL or None

## Examples

### Basic Usage

```python
from pyshotter import pyshotter

# Simple screenshot
with pyshotter() as sct:
    sct.shot()

# Screenshot with cursor
with pyshotter(with_cursor=True) as sct:
    sct.shot()

# Screenshot of specific monitor
with pyshotter() as sct:
    sct.shot(mon=1)  # Second monitor
```

### Advanced Usage

```python
from pyshotter import pyshotter, AnnotationFeature, SharingFeature

with pyshotter() as sct:
    # Capture screenshot
    screenshot = sct.grab(sct.monitors[0])
    
    # Annotate
    annotator = AnnotationFeature()
    annotated = annotator.add_text(screenshot, "Hello World!", (100, 100))
    annotated = annotator.add_rectangle(annotated, (50, 50), (300, 200))
    
    # Share
    sharer = SharingFeature()
    sharer.copy_to_clipboard(annotated)
    
    # Save
    annotated.save("final_screenshot.png")
```

## Development

### Setup Development Environment

```shell
git clone https://github.com/utachicodes/pyshotter.git
cd pyshotter
python -m pip install -e ".[dev]"
```

### Running Tests

```shell
python -m pytest
```

### Code Quality Checks

```shell
# Format code
ruff format src/

# Lint code
ruff check src/

# Type checking
mypy src/

# Run all checks
ruff check src/ && mypy src/ && python -m pytest
```

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

### Development Guidelines

1. **Code Style**: Follow PEP 8 and use Ruff for formatting
2. **Type Hints**: All functions should have proper type annotations
3. **Documentation**: Add docstrings for all public functions
4. **Tests**: Write tests for new features
5. **Examples**: Update examples when adding new features

## License

This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.

## Author

**Abdoullah Ndao** - [GitHub](https://github.com/utachicodes) - abdoullahaljersi@gmail.com

## Acknowledgments

- Built with love for the Python community
- Cross-platform compatibility using ctypes
- Smart features for modern development workflows
- Inspired by the need for better screenshot tools in Python

## Support

- **Documentation**: [https://pyshotter.readthedocs.io](https://pyshotter.readthedocs.io)
- **Issues**: [GitHub Issues](https://github.com/utachicodes/pyshotter/issues)
- **Discussions**: [GitHub Discussions](https://github.com/utachicodes/pyshotter/discussions)
- **Email**: abdoullahaljersi@gmail.com

---

**PyShotter** - Making screenshots smart, annotated, and shareable!

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyshotter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Abdoullah Ndao <abdoullahaljersi@gmail.com>",
    "keywords": "annotation, change detection, cross-platform, history, hotkeys, ocr, panorama, python, redaction, screen capture, screenshot, sharing, smart detection, text extraction",
    "author": null,
    "author_email": "Abdoullah Ndao <abdoullahaljersi@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/38/83/dd000e467fb82e93426dd2112def124ffee54c5a267a4da1fe28ca2bfb27/pyshotter-1.0.0.tar.gz",
    "platform": null,
    "description": "# PyShotter\n\n[![PyPI version](https://badge.fury.io/py/pyshotter.svg)](https://badge.fury.io/py/pyshotter)\n[![Tests workflow](https://github.com/utachicodes/pyshotter/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/utachicodes/pyshotter/actions/workflows/tests.yml)\n[![Downloads](https://static.pepy.tech/personalized-badge/pyshotter?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/pyshotter)\n\n> [!TIP]\n> **PyShotter** - Smart, annotated, and shareable screenshots for Python.\n\n```python\nfrom pyshotter import pyshotter\n\n# The simplest use, save a screenshot of the 1st monitor\nwith pyshotter() as sct:\n    sct.shot()\n```\n\nAn ultra-fast cross-platform screenshot library that makes it easy to capture, annotate, and share screenshots from your Python code.\n\n## Features\n\n### Smart Detection\n- **Code Region Detection** - Automatically detect code blocks and windows using computer vision\n- **Window Detection** - Smart identification of application windows and UI elements\n- **OCR Text Extraction** - Extract text from screenshots using Tesseract OCR engine\n- **Content Analysis** - Intelligent analysis of screenshot content for better processing\n\n### Rich Annotation\n- **Text Annotations** - Add text with custom fonts, sizes, and colors\n- **Shape Drawing** - Rectangles, circles, arrows, and custom geometric shapes\n- **Smart Highlighting** - Semi-transparent overlays for emphasis and focus\n- **Quick Markup** - One-line annotation commands for rapid screenshot editing\n- **Layer Management** - Multiple annotation layers with proper compositing\n\n### Easy Sharing\n- **Clipboard Copy** - Copy screenshots directly to system clipboard\n- **Shareable Links** - Generate instant shareable URLs for screenshots\n- **Cloud Upload** - Upload to cloud services with embedded metadata\n- **Cross-Platform** - Works seamlessly on Windows, macOS, and Linux\n- **Metadata Support** - Rich metadata embedding for better organization\n\n### Advanced Features\n- **Sensitive Data Redaction** - Automatically blur emails, phone numbers, credit cards, and SSNs\n- **Multi-Monitor Panorama** - Stitch all monitors into one panoramic image\n- **Change Detection** - Highlight changes between screenshots with configurable sensitivity\n- **Customizable Hotkeys** - Set global hotkeys for screenshot capture and annotation\n- **Screenshot History & Search** - Searchable history with metadata and OCR text indexing\n- **High Performance** - Optimized for speed and efficiency using ctypes\n- **Thread-Safe** - Safe for multi-threaded applications\n\n## Installation\n\n### Recommended Installation\n\n```shell\npython -m pip install -U --user pyshotter\n```\n\n### Optional Dependencies\n\nFor enhanced features, install additional dependencies:\n\n```shell\n# For OCR and advanced image processing\npython -m pip install pyshotter[ocr]\n\n# For annotation features\npython -m pip install pyshotter[annotation]\n\n# For sharing features\npython -m pip install pyshotter[sharing]\n\n# For cloud upload capabilities\npython -m pip install pyshotter[cloud]\n\n# For development\npython -m pip install pyshotter[dev]\n```\n\n## Quick Start\n\n### Basic Screenshot Capture\n\n```python\nfrom pyshotter import pyshotter\n\n# Take a screenshot of the first monitor\nwith pyshotter() as sct:\n    sct.shot()\n\n# Take screenshots of all monitors\nwith pyshotter() as sct:\n    for i, monitor in enumerate(sct.monitors):\n        sct.shot(mon=i)\n```\n\n### Smart Detection and Analysis\n\n```python\nfrom pyshotter import pyshotter, SmartDetectionFeature, OCRFeature\n\nwith pyshotter() as sct:\n    screenshot = sct.grab(sct.monitors[0])\n    \n    # Detect code regions and windows\n    detector = SmartDetectionFeature()\n    code_regions = detector.detect_code_regions(screenshot)\n    windows = detector.detect_windows(screenshot)\n    \n    print(f\"Found {len(code_regions)} code regions\")\n    print(f\"Found {len(windows)} windows\")\n    \n    # Extract text using OCR\n    ocr = OCRFeature()\n    text = ocr.extract_text(screenshot)\n    print(f\"Extracted text: {text}\")\n```\n\n### Rich Annotation\n\n```python\nfrom pyshotter import pyshotter, AnnotationFeature\n\nwith pyshotter() as sct:\n    screenshot = sct.grab(sct.monitors[0])\n    \n    # Initialize annotation\n    annotator = AnnotationFeature()\n    \n    # Add text annotation\n    annotated = annotator.add_text(\n        screenshot, \n        \"Important Code Here!\", \n        (100, 100),\n        font_size=24,\n        color=(255, 0, 0)  # Red text\n    )\n    \n    # Add rectangle around a region\n    annotated = annotator.add_rectangle(\n        annotated,\n        (50, 50),      # Top-left corner\n        (400, 200),    # Bottom-right corner\n        color=(0, 255, 0),  # Green rectangle\n        thickness=3\n    )\n    \n    # Add arrow pointing to something\n    annotated = annotator.add_arrow(\n        annotated,\n        (150, 150),    # Start point\n        (300, 100),    # End point\n        color=(0, 0, 255),  # Blue arrow\n        thickness=2\n    )\n    \n    # Add circle highlight\n    annotated = annotator.add_circle(\n        annotated,\n        (200, 150),    # Center point\n        30,             # Radius\n        color=(255, 255, 0),  # Yellow circle\n        thickness=2\n    )\n    \n    # Add highlight overlay\n    annotated = annotator.add_highlight(\n        annotated,\n        (100, 100, 200, 100),  # (x, y, width, height)\n        color=(255, 255, 0),    # Yellow highlight\n        alpha=0.3               # 30% transparency\n    )\n    \n    # Save the annotated screenshot\n    annotated.save(\"annotated_screenshot.png\")\n```\n\n### Easy Sharing\n\n```python\nfrom pyshotter import pyshotter, SharingFeature\n\nwith pyshotter() as sct:\n    screenshot = sct.grab(sct.monitors[0])\n    \n    # Initialize sharing\n    sharer = SharingFeature()\n    \n    # Copy to clipboard\n    if sharer.copy_to_clipboard(screenshot):\n        print(\"Screenshot copied to clipboard!\")\n    \n    # Generate shareable link\n    link = sharer.generate_shareable_link(screenshot)\n    print(f\"Shareable link: {link}\")\n    \n    # Save with metadata\n    metadata = {\n        \"title\": \"My Screenshot\",\n        \"description\": \"Screenshot taken with PyShotter\",\n        \"tags\": [\"python\", \"screenshot\", \"demo\"],\n        \"author\": \"Abdoullah Ndao\",\n        \"timestamp\": \"2024-12-19\"\n    }\n    \n    sharer.save_with_metadata(screenshot, \"screenshot.png\", metadata)\n```\n\n### Sensitive Data Redaction\n\n```python\nfrom pyshotter import pyshotter, RedactionFeature\n\nwith pyshotter() as sct:\n    screenshot = sct.grab(sct.monitors[0])\n    \n    # Initialize redaction\n    redaction = RedactionFeature()\n    \n    # Redact sensitive data\n    clean_screenshot = redaction.redact_sensitive_data(screenshot)\n    clean_screenshot.save(\"clean_screenshot.png\")\n```\n\n### Multi-Monitor Panorama\n\n```python\nfrom pyshotter import pyshotter, PanoramaFeature\n\nwith pyshotter() as sct:\n    # Capture all monitors\n    screenshots = []\n    for monitor in sct.monitors:\n        screenshot = sct.grab(monitor)\n        screenshots.append(screenshot)\n    \n    # Create panoramic image\n    panorama = PanoramaFeature()\n    panoramic_screenshot = panorama.create_panorama(screenshots)\n    panoramic_screenshot.save(\"panorama.png\")\n```\n\n### Change Detection\n\n```python\nimport time\nfrom pyshotter import pyshotter, ChangeDetectionFeature\n\nwith pyshotter() as sct:\n    # Take first screenshot\n    previous = sct.grab(sct.monitors[0])\n    \n    # Wait for changes\n    time.sleep(5)\n    \n    # Take second screenshot\n    current = sct.grab(sct.monitors[0])\n    \n    # Detect changes\n    detector = ChangeDetectionFeature()\n    changes = detector.detect_changes(current, previous, threshold=0.1)\n    changes.save(\"changes.png\")\n```\n\n### Screenshot History and Search\n\n```python\nfrom pyshotter import pyshotter, ScreenshotHistory\n\n# Initialize history manager\nhistory = ScreenshotHistory()\n\nwith pyshotter() as sct:\n    screenshot = sct.grab(sct.monitors[0])\n    \n    # Add to history with metadata\n    screenshot_id = history.add_screenshot(\n        screenshot,\n        metadata={\n            \"tags\": [\"desktop\", \"work\"],\n            \"window_title\": \"Example Window\",\n            \"description\": \"Sample screenshot for demonstration\"\n        }\n    )\n    \n    # Search history\n    results = history.search_history(\"work\")\n    for result in results:\n        print(f\"Found: {result['id']} - {result['timestamp']}\")\n```\n\n## API Reference\n\n### Core Functions\n\n#### `pyshotter(**kwargs)`\nFactory function that returns a platform-specific screenshot instance.\n\n**Parameters:**\n- `mon` (int): Monitor index (default: 0)\n- `output` (str): Output filename pattern\n- `with_cursor` (bool): Include cursor in screenshot\n- `compression_level` (int): PNG compression level (0-9)\n\n**Returns:**\n- Platform-specific screenshot instance\n\n#### `sct.shot(**kwargs)`\nTake a screenshot and save it to a file.\n\n**Parameters:**\n- `mon` (int): Monitor index or monitor dict\n- `output` (str): Output filename\n- `with_cursor` (bool): Include cursor\n\n**Returns:**\n- List of saved filenames\n\n#### `sct.grab(monitor)`\nCapture a screenshot without saving.\n\n**Parameters:**\n- `monitor` (dict): Monitor configuration\n\n**Returns:**\n- ScreenShot object\n\n### Smart Detection Features\n\n#### `SmartDetectionFeature.detect_code_regions(screenshot)`\nDetect code-like regions in screenshots.\n\n**Parameters:**\n- `screenshot` (ScreenShot): Screenshot to analyze\n\n**Returns:**\n- List of dictionaries with bounding boxes and confidence scores\n\n#### `SmartDetectionFeature.detect_windows(screenshot)`\nDetect application windows in screenshots.\n\n**Parameters:**\n- `screenshot` (ScreenShot): Screenshot to analyze\n\n**Returns:**\n- List of dictionaries with window bounding boxes\n\n### Annotation Features\n\n#### `AnnotationFeature.add_text(screenshot, text, position, font_size, color)`\nAdd text annotation to a screenshot.\n\n**Parameters:**\n- `screenshot` (ScreenShot): Screenshot to annotate\n- `text` (str): Text to add\n- `position` (tuple): (x, y) position\n- `font_size` (int): Font size\n- `color` (tuple): RGB color tuple\n\n**Returns:**\n- Annotated ScreenShot object\n\n#### `AnnotationFeature.add_rectangle(screenshot, top_left, bottom_right, color, thickness)`\nAdd rectangle annotation to a screenshot.\n\n**Parameters:**\n- `screenshot` (ScreenShot): Screenshot to annotate\n- `top_left` (tuple): Top-left corner (x, y)\n- `bottom_right` (tuple): Bottom-right corner (x, y)\n- `color` (tuple): RGB color tuple\n- `thickness` (int): Line thickness\n\n**Returns:**\n- Annotated ScreenShot object\n\n### Sharing Features\n\n#### `SharingFeature.copy_to_clipboard(screenshot)`\nCopy screenshot to system clipboard.\n\n**Parameters:**\n- `screenshot` (ScreenShot): Screenshot to copy\n\n**Returns:**\n- bool: Success status\n\n#### `SharingFeature.generate_shareable_link(screenshot, service)`\nGenerate a shareable link for the screenshot.\n\n**Parameters:**\n- `screenshot` (ScreenShot): Screenshot to share\n- `service` (str): Sharing service name\n\n**Returns:**\n- str: Shareable URL or None\n\n## Examples\n\n### Basic Usage\n\n```python\nfrom pyshotter import pyshotter\n\n# Simple screenshot\nwith pyshotter() as sct:\n    sct.shot()\n\n# Screenshot with cursor\nwith pyshotter(with_cursor=True) as sct:\n    sct.shot()\n\n# Screenshot of specific monitor\nwith pyshotter() as sct:\n    sct.shot(mon=1)  # Second monitor\n```\n\n### Advanced Usage\n\n```python\nfrom pyshotter import pyshotter, AnnotationFeature, SharingFeature\n\nwith pyshotter() as sct:\n    # Capture screenshot\n    screenshot = sct.grab(sct.monitors[0])\n    \n    # Annotate\n    annotator = AnnotationFeature()\n    annotated = annotator.add_text(screenshot, \"Hello World!\", (100, 100))\n    annotated = annotator.add_rectangle(annotated, (50, 50), (300, 200))\n    \n    # Share\n    sharer = SharingFeature()\n    sharer.copy_to_clipboard(annotated)\n    \n    # Save\n    annotated.save(\"final_screenshot.png\")\n```\n\n## Development\n\n### Setup Development Environment\n\n```shell\ngit clone https://github.com/utachicodes/pyshotter.git\ncd pyshotter\npython -m pip install -e \".[dev]\"\n```\n\n### Running Tests\n\n```shell\npython -m pytest\n```\n\n### Code Quality Checks\n\n```shell\n# Format code\nruff format src/\n\n# Lint code\nruff check src/\n\n# Type checking\nmypy src/\n\n# Run all checks\nruff check src/ && mypy src/ && python -m pytest\n```\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Development Guidelines\n\n1. **Code Style**: Follow PEP 8 and use Ruff for formatting\n2. **Type Hints**: All functions should have proper type annotations\n3. **Documentation**: Add docstrings for all public functions\n4. **Tests**: Write tests for new features\n5. **Examples**: Update examples when adding new features\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.\n\n## Author\n\n**Abdoullah Ndao** - [GitHub](https://github.com/utachicodes) - abdoullahaljersi@gmail.com\n\n## Acknowledgments\n\n- Built with love for the Python community\n- Cross-platform compatibility using ctypes\n- Smart features for modern development workflows\n- Inspired by the need for better screenshot tools in Python\n\n## Support\n\n- **Documentation**: [https://pyshotter.readthedocs.io](https://pyshotter.readthedocs.io)\n- **Issues**: [GitHub Issues](https://github.com/utachicodes/pyshotter/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/utachicodes/pyshotter/discussions)\n- **Email**: abdoullahaljersi@gmail.com\n\n---\n\n**PyShotter** - Making screenshots smart, annotated, and shareable!\n",
    "bugtrack_url": null,
    "license": "MIT License\n        Copyright (c) 2024-2025, Abdoullah Ndao\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "PyShotter: Smart, annotated, and shareable screenshots for Python.",
    "version": "1.0.0",
    "project_urls": {
        "Changelog": "https://github.com/utachicodes/pyshotter/blob/main/CHANGELOG.md",
        "Documentation": "https://github.com/utachicodes/pyshotter#readme",
        "Homepage": "https://github.com/utachicodes/pyshotter",
        "Source": "https://github.com/utachicodes/pyshotter",
        "Tracker": "https://github.com/utachicodes/pyshotter/issues"
    },
    "split_keywords": [
        "annotation",
        " change detection",
        " cross-platform",
        " history",
        " hotkeys",
        " ocr",
        " panorama",
        " python",
        " redaction",
        " screen capture",
        " screenshot",
        " sharing",
        " smart detection",
        " text extraction"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "33d0e08b13683628462dffd44ca48ab077131a7ef63cd7479aa2871e7fca9d9c",
                "md5": "a0ed16afcd5902ff8126b3637faac8d2",
                "sha256": "338973838ecb9baea96bb5764a66d3f76e707dc1f2956a64fd80218d2272bd86"
            },
            "downloads": -1,
            "filename": "pyshotter-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a0ed16afcd5902ff8126b3637faac8d2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 32826,
            "upload_time": "2025-07-13T21:21:56",
            "upload_time_iso_8601": "2025-07-13T21:21:56.420351Z",
            "url": "https://files.pythonhosted.org/packages/33/d0/e08b13683628462dffd44ca48ab077131a7ef63cd7479aa2871e7fca9d9c/pyshotter-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3883dd000e467fb82e93426dd2112def124ffee54c5a267a4da1fe28ca2bfb27",
                "md5": "5688b1badc442bb1a04349aa640564a3",
                "sha256": "63a4269661b406ea9026f40262c3cd35749460ae8028647b531a5245cffcc5c9"
            },
            "downloads": -1,
            "filename": "pyshotter-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5688b1badc442bb1a04349aa640564a3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 94118,
            "upload_time": "2025-07-13T21:22:02",
            "upload_time_iso_8601": "2025-07-13T21:22:02.107971Z",
            "url": "https://files.pythonhosted.org/packages/38/83/dd000e467fb82e93426dd2112def124ffee54c5a267a4da1fe28ca2bfb27/pyshotter-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-13 21:22:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "utachicodes",
    "github_project": "pyshotter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyshotter"
}
        
Elapsed time: 2.59510s