Skip to main content

Crossclip

A cross platform clipboard API for python.

Current State of the Package

Backends are written but untested. Package needs a better test suite.

Overview

About

Crossclip provides a standard python API for interacting with the system clipboard. As of now, Crossclip supports MacOS, Windows, and GNU/Linux desktop environments using Gtk and Qt environments. More environments can be added due to the modular design.

Dependencies

All systems

  • Pillow (5.4.0)

Linux

  • Gtk users: PyGObject
  • Qt users: PySide2

Windows

  • pywin32

Mac

  • pyobjc

Installation

This package is hosted on PyPI. Install via:

$ pip install crossclip

Usage

Here is an example program:

# Import the clipboard frontend class and Pillow Image package
from crossclip.clipboard import Clipboard
from PIL import Image

# Create a new clipboard instance
cb = Clipboard()

# Get text from the clipboard
mytext = cb.get_text()

# Get an image from the clipboard
myimg = cb.get_image() # myimg is a PIL.Image class

# Put text onto the clipboard
my_message = 'Hello World'
cb.set_text(my_message)

# Put an image onto the clipboard
cb.set_image(my_pil_image_instance)

# Access the backend instance
backend_text = cb.backend.get_text()

It's as easy as that. The frontend wraps all of the backend specifics and provides a simple, uniform interface.

Implementation Details

This library uses a collection of backends to provide clipboard functionality for a specific system or clipboard. For example, there is a clipboard backend for the Windows system clipboard and the Gtk+ clipboard. Each backend inherits from an abstract base class that provides a set of common abstract methods that each backend must implement.

Each of these backends are used in the frontend class, clipboard.Clipboard. The Clipboard class determines the backend to use based on the system platform determined by the sys.platform value. The Clipboard class carries an instance of the backend and uses its functions to provide clipboard functionality.

With a design like this, the library is extensible. New backends can be added and removed.

Contributing

See CONTRIBUTING.md

License

This package is licensed under the GPLv3.

Metadata

Release files for crossclip 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crossclip 0.2.2
File Size Uploaded Provenance Actions
crossclip-0.2.2.tar.gz 9.4 kB Without provenance Details for crossclip-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crossclip 0.2.2
File Interpreter ABI Platform Actions
crossclip-0.2.2-py3-none-any.whl Python 3 none any Details for crossclip-0.2.2-py3-none-any.whl

Total release size: 33.4 kB

Release files / crossclip-0.2.2.tar.gz

Download URL crossclip-0.2.2.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
926b7816446bc0a6508fdc4dd3511f9a328f851025dc9823f200347038954f29
BLAKE2b-256 checksum
How to use checksums
67cc0284dafab67f8d6cf145c91e20c8157358fb741aa20b1aaec5113dcae988
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release files / crossclip-0.2.2-py3-none-any.whl

Download URL crossclip-0.2.2-py3-none-any.whl
Size 24.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15a81ee0f65ce137bb99f870feb369dd31bdda5af30d8d7bee75ece6c293f603
BLAKE2b-256 checksum
How to use checksums
d0daf34e1c5fab92685dbc3e74f4ff083fb5a9708e7aab6f2db7c860e318484c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Security for crossclip 0.2.2

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.

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