pyperclip_plus
pyperclip_plusは、クリップボード管理ツールを強化するPythonパッケージです。テキストをクリップボードにコピーし、コピーされたテキストの履歴を保持し、メインとセカンダリのクリップボードを切り替え、コピー履歴を検索し、コピーおよび貼り付け操作を遅延させて実行することができます。
機能
- クリップボードへのコピー: テキストをクリップボードにコピーし、メインのクリップボードを使用している場合は履歴に保存します。
- クリップボードからの貼り付け: クリップボードから最新のテキストを貼り付けます。
- クリップボードの切り替え: メインとセカンダリのクリップボードを切り替えます。
- 履歴の検索: コピー履歴の中からキーワードで検索します。
- スケジュールされたコピーおよび貼り付け: 遅延後にコピーおよび貼り付け操作をスケジュールします。
インストール
pyperclip_plusはpipを使用してインストールできます:
pip install pyperclip_plus
使用方法
以下は、pyperclip_plusパッケージからClipboardManagerクラスを使用する例です:
from pyperclip_plus import ClipboardManager
manager = ClipboardManager()
manager.switch_to_main()
manager.copy("Hello, World!")
print(manager.paste()) # 出力: Hello, World!
print(manager.search_history("World")) # 出力: ['Hello, World!']
ClipboardManager クラス
メソッド
-
copy(text)
- 指定されたテキストをクリップボードにコピーし、現在のクリップボードがメインの場合は履歴に追加します。
- パラメータ:
text(str): コピーするテキスト。
-
paste()
- 現在のクリップボードがメインであれば、最新のテキストをクリップボードから貼り付けます。
- 戻り値: クリップボードからの最新のテキスト、またはクリップボードが選択されていない場合の適切なメッセージ。
-
switch_to_main()
- メインのクリップボードに切り替えます。
-
switch_to_secondary()
- セカンダリのクリップボードに切り替えます。
-
search_history(keyword)
- 指定されたキーワードを含む履歴エントリを検索します。
- パラメータ:
keyword(str): 検索するキーワード。 - 戻り値: キーワードを含む履歴アイテムのリスト。
-
schedule_copy(text, delay)
- 指定された遅延後にコピー操作をスケジュールします。
- パラメータ:
text(str): コピーするテキスト。delay(int): コピー操作を行うまでの遅延時間(秒単位)。
-
schedule_paste(delay)
- 指定された遅延後に貼り付け操作をスケジュールします。
- パラメータ:
delay(int): 貼り付け操作を行うまでの遅延時間(秒単位)。
setup.py
setup.pyスクリプトは、pyperclip_plusプロジェクトをパッケージ化するために使用されます。
from setuptools import setup, find_packages
import pathlib
here = pathlib.Path(__file__).parent
long_description = (here / "README.md").read_text(encoding="utf-8")
setup(
name='pyperclip_plus',
version='0.1.2',
packages=find_packages(),
description='クリップボード管理ツールの強化版',
author='Your Name',
author_email='your.email@example.com',
url='https://github.com/yourusername/pyperclip_plus',
long_description=long_description,
long_description_content_type="text/markdown",
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
],
)
このスクリプトは、パッケージ名、バージョン、説明、作者情報、プロジェクトURL、長い説明、分類子など、必要なメタデータを設定してパッケージを構築します。プロジェクトをパッケージ化する前に、プレースホルダを実際の情報に置き換えるようにしてください。
Metadata
Release files for pyperclip-plus 0.1.2
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 | |
|---|---|---|---|---|
| pyperclip_plus-0.1.2.tar.gz | 3.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyperclip_plus-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.1 kB
Release files / pyperclip_plus-0.1.2.tar.gz
| Download URL | pyperclip_plus-0.1.2.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3cdc8d747bb5b18d013b2e87f7e3e51672702d956897d76565c46b3dfd2eacd5
|
|
BLAKE2b-256 checksum How to use checksums |
d0bb4bdd16092478da248fe3e0fa1f3fdd478bf944ea4b7e07772e39e57ec3b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.16
|
Release files / pyperclip_plus-0.1.2-py3-none-any.whl
| Download URL | pyperclip_plus-0.1.2-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e4a3422374934b8d624fb016bd85fad92750e57afee2f0b66bd423fcdf9780b
|
|
BLAKE2b-256 checksum How to use checksums |
da83495731d4b042b9e0d63d06b224c651f94d95b2727f6116151e9117e3ed4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.16
|
Security for pyperclip-plus 0.1.2
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.