Metadata-Version: 2.4
Name: philiprehberger-clipboard
Version: 0.1.2
Summary: Cross-platform clipboard copy and paste in one function call
Project-URL: Homepage, https://github.com/philiprehberger/py-clipboard
Project-URL: Repository, https://github.com/philiprehberger/py-clipboard
Project-URL: Issues, https://github.com/philiprehberger/py-clipboard/issues
Author: Philip Rehberger
License-Expression: MIT
License-File: LICENSE
Keywords: cli,clipboard,copy,cross-platform,paste
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# philiprehberger-clipboard

[![Tests](https://github.com/philiprehberger/py-clipboard/actions/workflows/publish.yml/badge.svg)](https://github.com/philiprehberger/py-clipboard/actions/workflows/publish.yml)
[![PyPI version](https://img.shields.io/pypi/v/philiprehberger-clipboard.svg)](https://pypi.org/project/philiprehberger-clipboard/)
[![License](https://img.shields.io/github/license/philiprehberger/py-clipboard)](LICENSE)

Cross-platform clipboard copy and paste in one function call.

## Install

```bash
pip install philiprehberger-clipboard
```

## Usage

```python
from philiprehberger_clipboard import copy, paste

copy("Hello, clipboard!")
text = paste()
print(text)  # Hello, clipboard!
```

### CLI

Copy text from stdin:

```bash
echo "Hello" | python -m philiprehberger_clipboard copy
```

Paste clipboard contents to stdout:

```bash
python -m philiprehberger_clipboard paste
```

Or use the installed script:

```bash
echo "Hello" | clipboard copy
clipboard paste
```

## API

| Function | Description |
|---|---|
| `copy(text: str) -> None` | Copy a string to the system clipboard |
| `paste() -> str` | Read a string from the system clipboard |
| `ClipboardError` | Raised when clipboard tool is unavailable or operation fails |

### Platform support

| Platform | Copy | Paste |
|---|---|---|
| Windows | `clip.exe` | PowerShell `Get-Clipboard` |
| macOS | `pbcopy` | `pbpaste` |
| Linux (X11) | `xclip` or `xsel` | `xclip` or `xsel` |
| Linux (Wayland) | `wl-copy` | `wl-paste` |

## License

MIT
