Skip to main content

Clipboard-backed Swarmauri state provider for transient desktop workflows and local automation.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_state_clipboard Discord

Swarmauri State Clipboard

swarmauri_state_clipboard provides a Swarmauri StateBase implementation that stores state in the system clipboard. It is useful for desktop prototyping, local demos, quick workflow handoffs, and lightweight human-in-the-loop tooling where a full database or cache would be unnecessary.

Why Use Swarmauri State Clipboard

  • Persist small state payloads without adding external infrastructure.
  • Bridge state between local tools, notebooks, shells, and GUI apps.
  • Prototype Swarmauri stateful flows quickly on Windows, macOS, or Linux.
  • Keep local development loops simple when you only need transient state.

FAQ

What does this package store?
It stores dictionary-shaped data by serializing it to the system clipboard.

Which platforms are supported?
Windows uses clip and PowerShell Get-Clipboard, macOS uses pbcopy and pbpaste, and Linux uses xclip.

Is this suitable for production workloads?
Usually no. The clipboard is global, user-facing, and not designed for secure or concurrent application state.

How is clipboard data parsed when reading?
The package uses ast.literal_eval to parse string content into Python literals.

Features

  • Swarmauri StateBase implementation registered as ClipboardState.
  • Cross-platform clipboard access through built-in OS utilities.
  • Read, write, update, reset, and deep-copy state helpers.
  • No third-party runtime dependency beyond core Swarmauri packages.
  • Supports Python 3.10, 3.11, 3.12, 3.13, and 3.14.

Installation

uv add swarmauri_state_clipboard
pip install swarmauri_state_clipboard

Usage

from swarmauri_state_clipboard import ClipboardState

state = ClipboardState()
state.write({"session": "abc123", "step": 1})

print(state.read())

state.update({"step": 2})
print(state.read())

Examples

Use clipboard state in a local prototype

from swarmauri_state_clipboard import ClipboardState

state = ClipboardState()
state.write({"draft": "ready", "owner": "local-user"})

print(state.read())

Reset state after a task completes

from swarmauri_state_clipboard import ClipboardState

state = ClipboardState()
state.write({"job": "complete"})
state.reset()

print(state.read())  # {}

Clone the current state for a second workflow branch

from swarmauri_state_clipboard import ClipboardState

state = ClipboardState()
state.write({"request_id": "req-001", "status": "queued"})

forked_state = state.deep_copy()
forked_state.update({"status": "processed"})

print(state.read())
print(forked_state.read())

Related Packages

Swarmauri Foundations

More Documentation

Best Practices

  • Keep clipboard payloads small and short-lived.
  • Avoid storing secrets or sensitive tokens in clipboard-backed state.
  • Install xclip explicitly on Linux hosts and CI runners.
  • Prefer a durable state backend for concurrent, remote, or production flows.

License

This project is licensed under the Apache-2.0 License.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_state_clipboard-0.11.0.dev1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swarmauri_state_clipboard-0.11.0.dev1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_state_clipboard-0.11.0.dev1.tar.gz.

File metadata

  • Download URL: swarmauri_state_clipboard-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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}

File hashes

Hashes for swarmauri_state_clipboard-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 566740b9c5bb01edba12aa0ad7160e4f59b5dbcdb9cf46965edc382645365085
MD5 1010233f1f968e24044d7242dca8b7a9
BLAKE2b-256 96e190186cfbdec815f6942647e4bb6c4b810b87cdbc2998ff86d0f0943fa33f

See more details on using hashes here.

File details

Details for the file swarmauri_state_clipboard-0.11.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_state_clipboard-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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}

File hashes

Hashes for swarmauri_state_clipboard-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 4d9c49affa4676b7b230ebcfab03b1d203f0a2b2f618e27b0ea72b73a1aae87a
MD5 97918395f8e17fbd77a4396dd5620c5a
BLAKE2b-256 965ac7a93698cc95b1fea9ceb8b5f1dcf78837b5d2b66697e1052e15eeaa486f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page