PyScreenGrab
A simple and efficient screen recording and streaming tool written in Python.
✨ Features
-
Multiple capture modes(Full Screen/Custom Region/Window)
-
Local video recording
-
Preview mode
-
Adjustable FPS (1-60)
-
Timed recording option
-
Simple command-line interface
-
Reactive streaming support
-
🔴 Note: Window capture may not work properly with virtual monitors. use a physical monitor for best results
📦 Installation
pip install py-screen-grab
🚀 Usage
Command Line Interface
Simply run:
screengrab
Follow the interactive prompts to:
- Select capture mode (Full Screen/Custom Region/Window)
- Choose monitor or set region
- Set FPS
- Choose recording mode (Preview/Record)
- Set recording duration (optional)
Python API
1. Custom Region Capture
from py_screen_grab import ScreenGrabber
# Capture a specific region
grabber = ScreenGrabber()
.set_roi(x=100, y=100, width=800, height=600)
.set_fps(30)
# Record with preview
grabber.record()
2. Window Capture
from py_screen_grab import ScreenGrabber
# Capture a specific window
# The ROI is automatically set based on the window's position and size
grabber = ScreenGrabber()
.set_window("Window Title")
.set_fps(30)
# Record with preview
grabber.record()
3. Streaming
from py_screen_grab import ScreenGrabber
grabber = ScreenGrabber()
.set_roi(x=0, y=0, width=1920, height=1080)
.set_fps(30)
# Start streaming
grabber.start_streaming()
📋 Requirements
- wmctrl (required for window management on Linux, especially 🐧Ubuntu)
- Python 3.6 or higher
- OpenCV
- NumPy
- MSS (screen capture library)
- aiortc (for WebRTC streaming)
- rx (for reactive streaming)
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
We welcome contributions to this project! Please see our CONTRIBUTING.md for guidelines on how to get started.
Metadata
Release files for py-screen-grab 1.5.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 |
|---|---|---|---|---|
| py_screen_grab-1.5.0.tar.gz | 10.4 kB | With provenance | Details for py_screen_grab-1.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| py_screen_grab-1.5.0-py3-none-any.whl | Python 3 | none | any | Details for py_screen_grab-1.5.0-py3-none-any.whl |
Total release size: 20.5 kB
Release files / py_screen_grab-1.5.0.tar.gz
| Download URL | py_screen_grab-1.5.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ccfd0db02c45f9bffef6e7c6bdc2b969a4f5b7be3b3f4aed7956837bbdda99f5
|
|
BLAKE2b-256 checksum How to use checksums |
136e51f4b24f3ba9bec4b67bb7a1c583da1f4c39a2a63c9409077ec582fbbe56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 17, 2025.
Transparency logRelease files / py_screen_grab-1.5.0-py3-none-any.whl
| Download URL | py_screen_grab-1.5.0-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e9a8b0adc44372d1d429bc71229d622bfa9239165fbb440cc006a7d41529d03
|
|
BLAKE2b-256 checksum How to use checksums |
9d82c7fceac7dd2778f6cecdd55cadf4bdb52179bb9f1e82676fc0f3eb5837cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 17, 2025.
Transparency logSecurity for py-screen-grab 1.5.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for py_screen_grab-1.5.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 17, 2025.
Transparency logA 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.