Process clipboard content and show helpful overlays or notifications based on the content, e.g. parse UNIX timestamps, AWS account IDs, VINs, base64 strings and more.
Project description
clipboard-processor
Process clipboard content and show helpful overlays or notifications based on the content, e.g. parse UNIX timestamps, AWS account IDs, VINs, base64 strings and more.
All parsing & decoding is done locally. The clipboard content is not sent to any external service.
Installation
Some features require additional libraries to be installed (see below).
Install with required dependencies only:
pip install clipboard-processor
Install with all optional dependencies (recommended):
pip install clipboard-processor[all]
Usage
clipboard-processor
Show help:
clipboard-processor --help
Run with xclip-primary input mode:
clipboard-processor --input xclip-primary
Functionality
Input
There are different input modes available:
Mode | Description |
---|---|
auto |
Use pyperclip for cross-platform clipboard access. This is the default. |
xclip-primary |
Use the primary selection on linux via xclip . No explicit copy operation is needed – selecting the text is sufficient. Requires xclip command in the search path. |
Plugins
All decoding functionality is provided via plugins. Per default, all available plugins are enabled.
Plugin | Description | External library |
---|---|---|
aws_account_id |
Show AWS account name for given AWS account ID by parsing ~/.aws/config |
- |
base64 |
Decode base64 strings | - |
hex-utf8 |
Decode printable UTF-8 strings from hexadecimal representation | - |
jwt |
Decode JSON web tokens (JWTs) | PyJWT |
oui |
Show vendor name for given MAC address or OUI (see IEEE OUI database) | netaddr |
ulid |
Parse ULIDs and show the encoded timestamp | python-ulid |
unixtime |
Parse UNIX timestamps and show the human-readable (ISO 8601) time | - |
vin |
Decode Vehicle Identification Numbers (VINs) | vininfo |
Output
There are different output modes available:
Mode | Description |
---|---|
ui |
Use tkinter overlay near the current mouse position to show the output. This is the default. |
notify |
Use desktop-notifier to show the output in a desktop notification. |
stdout |
Print the result of the processing to the standard output. This is mostly intended for debugging and testing. |
Development
This project uses Hatch for managing the development environment.
Prerequisites
Install xvfb
for running the snapshot tests.
TODO: some more effort might be necessary to support Windows and macOS.
Run all tests
hatch test --all
hatch run test-minimal:run
hatch run test-snapshot:run
Create environment for IntelliJ
Create a development environment in .venv/
which can easily be used by IntelliJ or other IDEs:
hatch env create dev
Run development version
hatch shell
clipboard-processor
or
hatch run clipboard-processor
Troubleshooting
In case dependencies are not synced into an existing env, try removing all environments:
hatch env prune
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
Built Distribution
File details
Details for the file clipboard_processor-0.2.0.tar.gz
.
File metadata
- Download URL: clipboard_processor-0.2.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f515d04c4e675be9b7c497bc7a8703854e719c2e407a65dd3c1368c27780586 |
|
MD5 | 49989bd0f3b443135434f53a5c231489 |
|
BLAKE2b-256 | f5474ee65883a0e5823a0ce1b86b6e4c8fe09347e093a3dc31c82fa7f51b6fb7 |
File details
Details for the file clipboard_processor-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: clipboard_processor-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a7cd85e16f60391ea4a7b64faaa395a5fdcb5e6b15ad8cf9fd9340bf5d1daef |
|
MD5 | 5703a8440a1b8289fe05b35c9cc47ea4 |
|
BLAKE2b-256 | e289f59965e1e86f4a32c21d8c6255b7d76db0bdde5ab8dfd73c4a2ed29b2c72 |