Copy + Paste in Python.
Latest commit 4df98ab Jul 30, 2016 @kennethreitz committed on GitHub Merge pull request #29 from anne-decusatis/patch-1
Update README with linux dependency
Failed to load latest commit information.
xerox Update Feb 5, 2016
.gitignore 2012 Jan 13, 2012
LICENSE 2016 Feb 4, 2016 for pypi. Sep 9, 2010
README.rst Update README with linux dependency Jul 29, 2016 v0.4.1 Feb 4, 2016 Allow optional X selection copy/paste on Linux Jul 13, 2014


Xerox: Copy + Paste for Python

Xerox is a copy + paste module for python. It's aim is simple: to be as incredibly simple as possible.

Supported platforms are currently OS X, X11 (Linux, BSD, etc.), and Windows.

If you can make it simpler, please fork.


Usage is as follows:

xerox.copy(u'some string')

And to paste:

>>> xerox.paste()
u'some string'

On Linux you can optionally also copy into the X selection clipboard for middle-click-paste capability:

xerox.copy(u'Some string', xsel=True)

And you can choose to paste from the X selection rather than the system clipboard:


And, that's it.

Command Line

To copy:

$ xerox some string


$ echo some string | xerox

To paste:

>>> xerox
some string


To install Xerox, simply:

$ pip install xerox

Note: If you are installing xerox on Windows, you will also need to install the pywin32 module.

Note: On X11 systems, Xerox requires Xclip, which can be found through your system package manager (e.g. apt-get install xclip) or at

Legal Stuff

MIT License.

(c) 2016 Kenneth Reitz.