Skip to main content

PyScreenGrab

A simple and efficient screen recording and streaming tool written in Python.

PyPI PyPI Downloads License



✨ 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:

  1. Select capture mode (Full Screen/Custom Region/Window)
  2. Choose monitor or set region
  3. Set FPS
  4. Choose recording mode (Preview/Record)
  5. 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)

Source distribution for py-screen-grab 1.5.0
File Size Uploaded
py_screen_grab-1.5.0.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-screen-grab 1.5.0
File Interpreter ABI Platform
py_screen_grab-1.5.0-py3-none-any.whl Python 3 none any Details

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 log

Release 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 log

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files

1.4.0

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page