Skip to main content

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 クラス

メソッド

  1. copy(text)

    • 指定されたテキストをクリップボードにコピーし、現在のクリップボードがメインの場合は履歴に追加します。
    • パラメータ: text (str): コピーするテキスト。
  2. paste()

    • 現在のクリップボードがメインであれば、最新のテキストをクリップボードから貼り付けます。
    • 戻り値: クリップボードからの最新のテキスト、またはクリップボードが選択されていない場合の適切なメッセージ。
  3. switch_to_main()

    • メインのクリップボードに切り替えます。
  4. switch_to_secondary()

    • セカンダリのクリップボードに切り替えます。
  5. search_history(keyword)

    • 指定されたキーワードを含む履歴エントリを検索します。
    • パラメータ: keyword (str): 検索するキーワード。
    • 戻り値: キーワードを含む履歴アイテムのリスト。
  6. schedule_copy(text, delay)

    • 指定された遅延後にコピー操作をスケジュールします。
    • パラメータ: text (str): コピーするテキスト。 delay (int): コピー操作を行うまでの遅延時間(秒単位)。
  7. 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、長い説明、分類子など、必要なメタデータを設定してパッケージを構築します。プロジェクトをパッケージ化する前に、プレースホルダを実際の情報に置き換えるようにしてください。

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)

Source distribution for pyperclip-plus 0.1.2
File Size Uploaded
pyperclip_plus-0.1.2.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyperclip-plus 0.1.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.4

2 release files

0.1.3

2 release files

This release

0.1.2 This release

2 release files

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page