Skip to main content

No project description provided

Project description

copykitten

copykitten provides a robust, dependency-free way to use the system clipboard in Python.

Installation

copykitten supports Python >= 3.8.

You can install copykitten from PyPI using pip or any other Python package manager.

pip install copykitten

Usage

The package API consists of three Python functions: copy, paste, clear.

In a nutshell:

import copykitten

copykitten.copy("The kitten says meow")

content = copykitten.paste()
print(content) # >>> "The kitten says meow"

copykitten.clear()
content = copykitten.paste() # Careful! May raise on Windows and macOS.

print(content) # >>> ""

Rationale

At the time of writing, there are very few Python packages that handle the clipboard. Most of them are simply no longer maintained (including the most popular solution around the web, pyperclip).

They all depend on external command-line tools like xclip/pbcopy or libraries like PyQt/GTK. You have to make sure these dependencies are installed on the target machine, otherwise they won’t work.

There are some solutions using the Tkinter library, which comes with the standard Python suite. However, these solutions are fragile and may leave your app unresponsive.

Copykitten is a lightweight wrapper around the Rust arboard library. It comes with pre-built wheels for Linux (x64, ARM64), macOS (x64, ARM64), and Windows (x64), so you don't have to worry about anything.

What's in a name?

You can’t even imagine, how many Python packages devoted to the clipboard management there are on PyPI! Most of them are abandoned for a decade, and all the neat obvious names (and even some rather creative ones) are already taken. So I had no choice, but to invent this tongue-in-cheek name. Also, my wife approved it.

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

copykitten-1.0.0.tar.gz (13.3 kB view hashes)

Uploaded Source

Built Distributions

copykitten-1.0.0-cp38-abi3-win_amd64.whl (113.1 kB view hashes)

Uploaded CPython 3.8+ Windows x86-64

copykitten-1.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (388.8 kB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

copykitten-1.0.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (378.5 kB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

copykitten-1.0.0-cp38-abi3-macosx_11_0_arm64.whl (181.5 kB view hashes)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

copykitten-1.0.0-cp38-abi3-macosx_10_12_x86_64.whl (185.9 kB view hashes)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

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