Skip to main content

This project Has Moved

Please see https://pypi.org/project/pyclip/

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 pyclip 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

Installing via pip also provides console script pyclip:

pyclip copy < my_file.txt

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

Metadata

Release files for pyperclip3 0.4.1

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

Source distribution (sdist)

Source distribution for pyperclip3 0.4.1
File Size Uploaded
pyperclip3-0.4.1.tar.gz 12.4 kB Details

Built distribution (wheel)

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

Total release size: 28.4 kB

Release files / pyperclip3-0.4.1.tar.gz

Download URL pyperclip3-0.4.1.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3d99793b610431624259190f48d60deb630643472f28e8012d425d8212acd27b
BLAKE2b-256 checksum
How to use checksums
29c439e7514d839255f8a6a41d98eefe53515d27a72f307359bb751e245a23b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.1

Release files / pyperclip3-0.4.1-py3-none-any.whl

Download URL pyperclip3-0.4.1-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4631290a04858313f410d72cc6f72cbfe732eca4572124b1c1ae98f1eb779451
BLAKE2b-256 checksum
How to use checksums
56098f71b75e1019670322fa55a3b94e01af8b8097dbd039331582a56a785999
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.1

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.1.1

2 release files

0.1.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