Skip to main content

Fastest Windows Screen Capture Library For Python 🔥

Project description

Windows Capture

Crates.io GitHub Workflow Status (with event) PyPI - Version

Windows Capture is a highly efficient Rust and Python library that enables you to capture the screen using the Graphics Capture API effortlessly. This library allows you to easily capture the screen of your Windows-based computer and use it for various purposes, such as creating instructional videos, taking screenshots, or recording your gameplay. With its intuitive interface and robust functionality, Windows Capture is an excellent choice for anyone looking for a reliable, easy-to-use screen-capturing solution.

Note this README.md is for Python library Rust library can be found here

Features

  • Only Updates The Frame When Required.
  • High Performance.
  • Easy To Use.
  • Latest Screen Capturing API.

Installation

Run this command

pip install windows-capture

Usage

from windows_capture import WindowsCapture, Frame, InternalCaptureControl

# Every Error From on_closed and on_frame_arrived Will End Up Here
capture = WindowsCapture(
    capture_cursor=None,
    draw_border=None,
    monitor_index=None,
    window_name=None,
)


# Called Every Time A New Frame Is Available
@capture.event
def on_frame_arrived(frame: Frame, capture_control: InternalCaptureControl):
    print("New Frame Arrived")

    # Save The Frame As An Image To The Specified Path
    frame.save_as_image("image.png")

    # Gracefully Stop The Capture Thread
    capture_control.stop()


# Called When The Capture Item Closes Usually When The Window Closes, Capture
# Session Will End After This Function Ends
@capture.event
def on_closed():
    print("Capture Session Closed")


capture.start()

Benchmark

Windows Capture Is The Fastest Python Screen Capture Library

Benchmark Showing Windows Capture Is The Fastest Python Screen Capture Library

Contributing

Contributions are welcome! If you find a bug or want to add new features to the library, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

windows_capture-1.0.45.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

windows_capture-1.0.45-cp311-none-win_amd64.whl (403.3 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

Details for the file windows_capture-1.0.45.tar.gz.

File metadata

  • Download URL: windows_capture-1.0.45.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.3.2

File hashes

Hashes for windows_capture-1.0.45.tar.gz
Algorithm Hash digest
SHA256 dc77b153b659382dd284dfce146c099af290cbb8cb88a5dad9e99f4559c708ab
MD5 4208db74b94d28bb64b33e0589194d15
BLAKE2b-256 8aaca244808de0c314d46fd3da27bc2278ff7f8178067e8599f6bd73b17f5103

See more details on using hashes here.

File details

Details for the file windows_capture-1.0.45-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for windows_capture-1.0.45-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 28aee4493a13efe8a76849b8371acdf9960123eee41f905eef9109ee5db36306
MD5 ec0883271bfce4792a95ac311f67b570
BLAKE2b-256 c91f7281af0e1ad10839b5a34cef6b86e60c888b9d9447fe77356ea95ff2e589

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page