Swarmauri State Clipboard
ClipboardState implements Swarmauri's StateBase interface using the system clipboard as storage. Useful for quick demos or sharing state between desktop tools without running an external datastore.
Features
- Reads/writes clipboard contents via platform commands (
clip,pbcopy/pbpaste,xclip). - Stores JSON-like dictionaries as string representations; uses
ast.literal_evalwhen reading. - Provides
write,read,update,reset, anddeep_copyhelpers.
Prerequisites
- Python 3.10 or newer.
- OS clipboard utilities available:
- Windows:
clip(built-in) and PowerShellGet-Clipboard. - macOS:
pbcopy/pbpaste(built-in). - Linux:
xclipinstalled (apt install xclipor equivalent).
- Windows:
Installation
# pip
pip install swarmauri_state_clipboard
# poetry
poetry add swarmauri_state_clipboard
# uv (pyproject-based projects)
uv add swarmauri_state_clipboard
Quickstart
from swarmauri_state_clipboard import ClipboardState
state = ClipboardState()
state.write({"key1": "value1", "counter": 42})
print(state.read())
state.update({"counter": 43})
print(state.read())
state.reset()
print(state.read()) # {}
Deep Copy
state = ClipboardState()
state.write({"session": "abc123"})
clone = state.deep_copy()
clone.update({"session": "xyz789"})
print(state.read()) # {'session': 'abc123'}
print(clone.read()) # {'session': 'xyz789'}
Tips
- Clipboard overwrites are global; avoid using this state provider in multi-user or production environments where clipboard privacy matters.
- Contents are stored as Python literal strings—avoid writing untrusted data to the clipboard to prevent evaluation issues (though
ast.literal_evalmitigates code execution risks). - Ensure required system commands exist before running in CI or containers (install
xclipfor Linux builds).
Want to help?
If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.
Metadata
Release files for swarmauri_state_clipboard 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| swarmauri_state_clipboard-0.9.0.tar.gz | 8.3 kB | Without provenance | Details for swarmauri_state_clipboard-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| swarmauri_state_clipboard-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for swarmauri_state_clipboard-0.9.0-py3-none-any.whl |
Total release size: 17.6 kB
Release files / swarmauri_state_clipboard-0.9.0.tar.gz
| Download URL | swarmauri_state_clipboard-0.9.0.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a06f2306366cf21ae7de0e00cbdb67fc25dc6de66f64cd392fe50a29097868e6
|
|
BLAKE2b-256 checksum How to use checksums |
d577c8b7deb1bfa29a7f97a993ad9f6d287434ad41938ecb88e2171ae9520779
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / swarmauri_state_clipboard-0.9.0-py3-none-any.whl
| Download URL | swarmauri_state_clipboard-0.9.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c23f56a106627d8ef0b3a79603d80a1ceaeb5c1e85007b33295150285acef70
|
|
BLAKE2b-256 checksum How to use checksums |
574b0e702273fa9743d7da244de1e5765607def429eba1ce0ad119233c8061de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for swarmauri_state_clipboard 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.