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、長い説明、分類子など、必要なメタデータを設定してパッケージを構築します。プロジェクトをパッケージ化する前に、プレースホルダを実際の情報に置き換えるようにしてください。

Download files

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

Source Distribution

pyperclip_plus-0.1.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

pyperclip_plus-0.1.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file pyperclip_plus-0.1.2.tar.gz.

File metadata

  • Download URL: pyperclip_plus-0.1.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.16

File hashes

Hashes for pyperclip_plus-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3cdc8d747bb5b18d013b2e87f7e3e51672702d956897d76565c46b3dfd2eacd5
MD5 1527451b191750e5c202812fef28d7f0
BLAKE2b-256 d0bb4bdd16092478da248fe3e0fa1f3fdd478bf944ea4b7e07772e39e57ec3b0

See more details on using hashes here.

File details

Details for the file pyperclip_plus-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pyperclip_plus-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.16

File hashes

Hashes for pyperclip_plus-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0e4a3422374934b8d624fb016bd85fad92750e57afee2f0b66bd423fcdf9780b
MD5 798b6f87394cddbd2f2b7daa6fbf0d18
BLAKE2b-256 da83495731d4b042b9e0d63d06b224c651f94d95b2727f6116151e9117e3ed4b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.4

2 files

0.1.3

2 files

This release

0.1.2 This release

2 files

0.1.1

1 file

0.1

1 file

Supported by

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