MCPcopy Create free account
hub / github.com/asweigart/pyperclip

github.com/asweigart/pyperclip @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
77 symbols 203 edges 4 files 8 documented · 10% 39 cross-repo links updated 11mo ago★ 1,843116 open issues

Browse by type

Functions 61 Types & classes 16
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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 qtpy or PyQT5 modules installed.

Support

If you find this project helpful and would like to support its development, consider donating to its creator on Patreon.

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 40
Method 21
Class 16

Languages

Python100%

Modules by API surface

src/pyperclip/__init__.py52 symbols
tests/test_pyperclip.py25 symbols

For agents

$ claude mcp add pyperclip \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page