Skip to main content

A cross-platform clipboard module for Python. (Only handles plain text for now.)

Project description

Pyperclip is a cross-platform Python module for copy and paste clipboard functions. It works with Python 2 and 3.

Install on Windows: pip install pyperclip

Install on Linux/macOS: pip3 install pyperclip

Al Sweigart al@inventwithpython.com BSD License

Example Usage

>>> import pyperclip
>>> pyperclip.copy('The text to be copied to the clipboard.')
>>> pyperclip.paste()
'The text to be copied to the clipboard.'

Currently only handles plaintext.

On Windows, no additional modules are needed.

On Mac, this module makes use of the pbcopy and pbpaste commands, which should come with the os.

On Linux, this module makes use of the xclip or xsel commands, which should come with the os. Otherwise run “sudo apt-get install xclip” or “sudo apt-get install xsel” (Note: xsel does not always seem to work.)

Otherwise on Linux, you will need the gtk or PyQt4 modules installed.

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

pyperclip-1.8.1.tar.gz (20.9 kB view details)

Uploaded Source

File details

Details for the file pyperclip-1.8.1.tar.gz.

File metadata

  • Download URL: pyperclip-1.8.1.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for pyperclip-1.8.1.tar.gz
Algorithm Hash digest
SHA256 9abef1e79ce635eb62309ecae02dfb5a3eb952fa7d6dce09c1aef063f81424d3
MD5 0ac879899da5c2af755a834245ca6a0f
BLAKE2b-256 6f4c0b1d507ad7e8bc31d690d04b4f475e74c2002d060f7994ce8c09612df707

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