Skip to main content

This is a small library for windows OS to work with clipboard data storage

Project description

This is a small library for windows OS to work with clipboard data storage. winclip32 is based on pywin32 module. https://github.com/PyPcDeV/winclip32

Installation

Only Windows OS

pip install winclip32

Code Examples

Example 1

import winclip32
winclip32.set_clipboard_data("unicode_std_text", "Python is beautiful!!!")
print(winclip32.get_clipboard_data("unicode_std_text")) # >>> Python is beautiful!!!

Example 2

import winclip32
winclip32.set_clipboard_data("unicode_std_text", "Python is beautiful!!!")
print(winclip32.is_clipboard_data_type_available("bitmapinfo_std_structure")) # >>> False
print(winclip32.is_clipboard_data_type_available(13)) # >>> True

Example 3

import winclip32
winclip32.get_clipboard_data_types_info() # >>> ...

API

winclip32.get_clipboard_formats_info() >> print all informations about winclip32 clipboard formats

winclip32.get_clipboard_data(format) >> format: str / int; return data or error if something went wrong

winclip32.set_clipboard_data(format, data) >> format: str / int; data: int/str/unicode/any object that supports the buffer interface; return data or error if something went wrong

winclip32.is_clipboard_format_available(format) >> format: str / int; return True if format is available, False if not, and error if something went wrong

winclip32.count_clipboard_formats() >> return the number of different formats currently on the clipboard.

winclip32.empty_clipboard() >> empty the clipboard

winclip32.Recorder(format=13, mark=None) >> format: str / int; mark: str; create a recorder for clipboard changes

winclip32.Recorder().record(record_interval=0.1) >> record_interval: int; record the clipboard changes and add them to the recording list or dict

winclip32.Recorder().get_recording() >> return the recorded list or dict

winclip32.Recorder().clear_recorder() >> clear the recording list or dict. use this for new records

winclip32.Recorder().set_format(format) >> format: str / int; set the main record format

winclip32.Recorder().set_mark(mark) >> mark: str; set the main record mark

Constants

  • winclip32.ANSI_STD_TEXT
  • winclip32.ANSI_MSL_TEXT
  • winclip32.ANCII_DIF_TEXT
  • winclip32.BIT8_DOS_TEXT
  • winclip32.UNICODE_STD_TEXT
  • winclip32.ANSI_DSP_TEXT
  • winclip32.HBITMAP_GDI_STD_OBJECT
  • winclip32.HBITMAP_GDI_DSP_OBJECT
  • winclip32.BITMAPINFO_STD_STRUCTURE
  • winclip32.METAFILEPICT_STD_STRUCTURE
  • winclip32.METAFILEPICT_DSP_STRUCTURE
  • winclip32.TIFF_STD_IMAGE
  • winclip32.HPALETTE_GDI_STD_OBJECT
  • winclip32.PENDATA_STD_DATA
  • winclip32.RIFF_STD_AUDIO
  • winclip32.WAVE_STD_AUDIO
  • winclip32.HENHMETAFILE_STD_HANDLE
  • winclip32.HENHMETAFILE_DSP_HANDLE
  • winclip32.DROPFILES_STD_LIST
  • winclip32.DWORD_STD_LCID
  • winclip32.BITMAPV5HEADER_STD_STRUCTURE
  • winclip32.NUMERIC_MARK
  • winclip32.STIME_MARK
  • winclip32.DTTIME_MARK

Update v0.6.0 --Recorder update--

Stable version of 0.6.0a

Update v0.6.0a --Recorder update--

  • Added Recorder() - record the clipboard changes and add them to the list or dict.

    • winclip32.Recorder(format=13, mark=None) >> format: str / int; mark: str; create a recorder for clipboard changes

    • winclip32.Recorder().record(record_interval=0.1) >> record_interval: int; record the clipboard changes and add them to the recording list or dict

    • winclip32.Recorder().get_recording() >> return the recorded list or dict

    • winclip32.Recorder().clear_recorder() >> clear the recording list or dict. use this for new records

    • winclip32.Recorder().set_format(format) >> format: str / int; set the main record format

    • winclip32.Recorder().set_mark(mark) >> mark: str; set the main record mark

  • Added mark-constants

    • winclip32.NUMERIC_MARK
    • winclip32.STIME_MARK
    • winclip32.DTTIME_MARK
  • Added new errors

    • winclip32.invalid_mark(m)
    • winclip32.invalid_format_type(f)

Update v0.5.4

  • Renamed

    • winclip32.get_clipboad_data_types_info() to winclip32.get_clipboard_formats_info()
    • winclip32.get_clipboard_data(type_key) to winclip32.get_clipboard_data(format)
    • winclip32.set_clipboard_data(type_key, data) to winclip32.set_clipboard_data(format, data)
    • winclip32.is_clipboard_data_type_available(type_key) to winclip32.is_clipboard_format_available(format)
    • winclip32.count_clipboard_data_types() to winclip32.count_clipboard_formats()
  • Added format constants

    • winclip32.ANSI_STD_TEXT
    • winclip32.ANSI_MSL_TEXT
    • winclip32.ANCII_DIF_TEXT
    • winclip32.BIT8_DOS_TEXT
    • winclip32.UNICODE_STD_TEXT
    • winclip32.ANSI_DSP_TEXT
    • winclip32.HBITMAP_GDI_STD_OBJECT
    • winclip32.HBITMAP_GDI_DSP_OBJECT
    • winclip32.BITMAPINFO_STD_STRUCTURE
    • winclip32.METAFILEPICT_STD_STRUCTURE
    • winclip32.METAFILEPICT_DSP_STRUCTURE
    • winclip32.TIFF_STD_IMAGE
    • winclip32.HPALETTE_GDI_STD_OBJECT
    • winclip32.PENDATA_STD_DATA
    • winclip32.RIFF_STD_AUDIO
    • winclip32.WAVE_STD_AUDIO
    • winclip32.HENHMETAFILE_STD_HANDLE
    • winclip32.HENHMETAFILE_DSP_HANDLE
    • winclip32.DROPFILES_STD_LIST
    • winclip32.DWORD_STD_LCID
    • winclip32.BITMAPV5HEADER_STD_STRUCTURE
  • Renamed errors. Current:

    • winclip32.invalid_clipboard_format_given(f)
    • winclip32.unknown_clipboard_format_given(f)
    • winclip32.clipboard_format_is_not_available(f)
    • winclip32.something_went_wrong
    • winclip32.invalid_clipboard_format_or_data_given

Project details


Download files

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

Source Distribution

winclip32-0.6.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

winclip32-0.6.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file winclip32-0.6.0.tar.gz.

File metadata

  • Download URL: winclip32-0.6.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for winclip32-0.6.0.tar.gz
Algorithm Hash digest
SHA256 18f7f5ad1df2db0cf72c583eb6cfd6f8f6aa33c6c77fc4d1de3bdfbc78611ddd
MD5 44039cdf8b581baa59b7bee965495023
BLAKE2b-256 02e26bbc25fdde7a4a848694e63eb0b152103ea2787297b74500c4d35692e940

See more details on using hashes here.

File details

Details for the file winclip32-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: winclip32-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for winclip32-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae6ab3df67fef71b772a7566e4feb5bc4a3ec0610ad6a72c0cc2d438cb2dbe1b
MD5 015b1fcb09215367d2e68042ea693ed8
BLAKE2b-256 ebb9efb5df2d4500fc740900090458b35e15e2c38a80c9a4e80ae74b2f2ceba8

See more details on using hashes here.

Supported by

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