Skip to main content

Cross-platform clipboard utilities supporting both binary and text data.

Project description

pyperclip3

Cross-platform clipboard utilities supporting both binary and text data.

Some key features include:

  • A cross-platform API (supports MacOS, Windows, Linux)
  • Can handle arbitrary binary data
  • On Windows, some additional clipboard formats are supported

Installation

Requires python 3.7+

pip install pyperclip3

Usage

pyperclip3 can be used in Python code

import pyperclip3

pyperclip3.copy("hello clipboard") # copy data to the clipboard
cb_data = pyperclip3.paste() # retrieve clipboard contents 
print(cb_data)

pyperclip3.clear() # clears the clipboard contents
assert not pyperclip3.paste()

Or a CLI

# paste clipboard contents to stdout
python -m pyperclip3 paste

# load contents to the clipboard from stdin
python -m pyperclip3 copy < myfile.text
# same as above, but pipe from another command
some-program | python -m pyperclip3 copy

This library implements functionality for several platforms and clipboard utilities.

  • MacOS
  • Windows
  • Linux (with xclip)

If there is a platform or utility not currently listed, please request it by creating an issue.

Platform specific notes/issues

Windows

  • On Windows, the pywin32 package is installed as a requirement.
  • On Windows, additional clipboard formats are supported, including copying from a file (like if you right-click copy from File Explorer)

MacOS

MacOS has support for multiple backends. By default, the pasteboard package is used.

pbcopy/pbpaste can also be used as a backend, but does not support arbitrary binary data, which may lead to data being lost on copy/paste. This backend may be removed in a future release.

Linux

Linux requires xclip to work (which means you must also use X). Install with your package manager, e.g. sudo apt install xclip

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

pyperclip3-0.4.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

pyperclip3-0.4.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file pyperclip3-0.4.0.tar.gz.

File metadata

  • Download URL: pyperclip3-0.4.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.0

File hashes

Hashes for pyperclip3-0.4.0.tar.gz
Algorithm Hash digest
SHA256 45b392f9169ee7c664794c1e19a098bc5aca0ec0972480f9beada426bcd2c28c
MD5 9a6bc6d7b92bfcf1d8e9a6b2880fde1f
BLAKE2b-256 c7a381e1efa4cac4fc3b7add8f473669999667da1e5030248f29c61967b1c052

See more details on using hashes here.

Provenance

File details

Details for the file pyperclip3-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: pyperclip3-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.0

File hashes

Hashes for pyperclip3-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15da7f62a88229baeae0b61112f346df449e2bbd77ecb32049c9839b65f004d0
MD5 4071471af63829877bed4ccd42945133
BLAKE2b-256 184dab224c6620b9b224ef4b1b19e914eb6538265b4acfa35f5a82b89f0989d8

See more details on using hashes here.

Provenance

Supported by

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