qshoot22
A simple and powerful Python library for taking screenshots.
Features
- 📸 Easy-to-use screenshot capture
- 🎯 Capture full screen or specific regions
- 💾 Save screenshots to custom directories
- 🔧 Return PIL Image objects for further processing
- 🐍 Python 3.8+ support
- 📦 Cross-platform (Windows, macOS, Linux)
Installation
pip install qshoot22
For development:
pip install qshoot22[dev]
Quick Start
Basic Usage
from qshoot2 import Screenshot
# Create a screenshot instance
shooter = Screenshot()
# Capture full screen and save
filepath = shooter.capture_full_screen()
print(f"Screenshot saved to: {filepath}")
# Capture full screen and get PIL Image object
image = shooter.capture_full_screen(return_image=True)
image.show()
Capture Region
# Capture a specific region (x, y, width, height)
shooter = Screenshot()
image = shooter.capture_region(100, 100, 500, 300, return_image=True)
image.show()
Custom Output Directory
from pathlib import Path
# Set custom output directory
shooter = Screenshot(output_dir=Path("./screenshots"))
filepath = shooter.capture_full_screen(filename="my_screenshot")
Utility Functions
from qshoot2 import capture, capture_region
# Quick capture
image = capture(return_image=True)
# Quick region capture
image = capture_region(0, 0, 200, 200, return_image=True)
Get Screen Size
from qshoot2 import Screenshot
width, height = Screenshot.get_screen_size()
print(f"Screen resolution: {width}x{height}")
Advanced Usage
With Custom Filename
shooter = Screenshot()
filepath = shooter.capture_full_screen(filename="desktop_2025")
Processing Screenshots
from qshoot2 import Screenshot
from PIL import Image, ImageFilter
shooter = Screenshot()
image = shooter.capture_full_screen(return_image=True)
# Apply filters
blurred = image.filter(ImageFilter.BLUR)
grayscale = image.convert('L')
# Save processed images
blurred.save("blurred.png")
grayscale.save("grayscale.png")
API Reference
Screenshot Class
__init__(output_dir=None)
Initialize Screenshot instance.
output_dir: Directory to save screenshots (default: current directory)
capture(region=None, filename=None, return_image=False)
Take a screenshot.
region: Tuple of (x, y, width, height) for partial screenshotfilename: Custom filename (without extension)return_image: If True, returns PIL Image object- Returns: PIL Image object or Path to saved file
capture_full_screen(filename=None, return_image=False)
Capture full screen.
filename: Custom filenamereturn_image: If True, returns PIL Image object- Returns: PIL Image object or Path to saved file
capture_region(x, y, width, height, filename=None, return_image=False)
Capture a specific region.
x, y: Top-left coordinateswidth, height: Dimensions of regionfilename: Custom filenamereturn_image: If True, returns PIL Image object- Returns: PIL Image object or Path to saved file
get_screen_size()
Get the screen resolution.
- Returns: Tuple of (width, height)
Requirements
- Python 3.8+
- pyautogui >= 0.9.54
- Pillow >= 10.0.0
Development
Running Tests
pytest
Code Formatting
black qshoot2 tests
isort qshoot2 tests
Type Checking
mypy qshoot2
License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
If you encounter any issues, please report them on the GitHub Issues page.
Changelog
0.1.0 (2025-01-19)
- Initial release
- Basic screenshot capture functionality
- Full screen and region capture
- Custom output directory support
- PIL Image object return option
Metadata
Release files for qshoot2 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qshoot2-0.1.0.tar.gz | 10.3 kB | Without provenance | Details for qshoot2-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qshoot2-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for qshoot2-0.1.0-py3-none-any.whl |
Total release size: 17.1 kB
Release files / qshoot2-0.1.0.tar.gz
| Download URL | qshoot2-0.1.0.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b721fd9815b08fa3a4991c7c02d2823f08a33a97a49d291990341e57652d87d6
|
|
BLAKE2b-256 checksum How to use checksums |
34f13651fb0c70aba54eeb9901cf7684ce75e00331eb19428a3c9acc181bef78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / qshoot2-0.1.0-py3-none-any.whl
| Download URL | qshoot2-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
813659bc481d8854460d92bbd474f320e2bc709ac14f68a7fa4bf6c0863a41ec
|
|
BLAKE2b-256 checksum How to use checksums |
ab77c5509c4dd9ff33fa61118cd2858e335fc2b5068714d207dd062a1c26c749
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for qshoot2 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.