Skip to main content

Server to run ytclip.

Project description

pyjpgclipboard

Platform Unit Tests

Actions Status Actions Status Actions Status

Note: Ubuntu/Linux is not implemented yet. The implementation should use xclip, preferably with binaries downloaded in another python package so that the user doesn't need to first install xclip from the apt package repository. Feel free to submit a pull request!

Brief

Cross platform clipboard for handling copy/paste jpg in python

This libray is meant to do only one thing and one thing well: copy jpg's to and from the system clipboard.

Install

python -m pip install pyjpgclipboard

Api

from pyjpgclipboard import clipboard_dump_jpg, clipboard_load_jpg

clipboard_load_jpg("myfile.jpg") # Clipboard now has jpg image
clipboard_dump_jpg("myfile2.jpg) # Clipboard image contents dumped to disk.

Testing

Make sure that tox is installed on your system and run it at the root directory of this project.

Will pyjpgclipboard support more features?

Probably not. Unless it's really important.

We only support jpg images (and not any other formats or text) because manipulating the system clipboard across different platforms is hard. As of the creation of this repo there really isn't any library that allows users to copy / paste jpegs. There are a lot of libraries that allow cross platform posting of text and binary data. So this library is intended to fill in that gap. Libraries like pyclip should, in the future, use pyjpgclipboard to handle the missing jpg clipboard manipulation.

What motivatated this library?

Selenium webdriver tests has a missing feature of taking an image and pasting it through it's api.

This is a problem if you are running a selenium test and you need to be able to test pasting an image as part of your test suite (hence the motivation to create this library).

Footguns

There is only one system clipboard. So running this library in different threads/processes will result in collisions. It's up to the application running this library to provide any necessary locking mechanism.

Versions

  • 1.0.2: Now installs on linux. Before it would error. But not all codepaths that include this library will actually use it.
  • 1.0.1: Bug fix
  • 1.0.0: Release.

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

pyjpgclipboard-1.0.2.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

pyjpgclipboard-1.0.2-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pyjpgclipboard-1.0.2.tar.gz.

File metadata

  • Download URL: pyjpgclipboard-1.0.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for pyjpgclipboard-1.0.2.tar.gz
Algorithm Hash digest
SHA256 946d52dce194209bbfad9159361d36bb39eaa53e10d77d5825e21a191e0c54b6
MD5 8b7330192466beea84e79ad454c70c8c
BLAKE2b-256 c6a5dfd321cdc08ccc126c3f2c76c1ae93588a6b153aac6c37307758c8d6931c

See more details on using hashes here.

File details

Details for the file pyjpgclipboard-1.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pyjpgclipboard-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0fc604e01cdce0e63f38376c1b9386eaa540f99b991217ed7d9dfd67bfdd21c6
MD5 6706360784145848b0a94f99f28a4f8a
BLAKE2b-256 538a4be48b7a2986c4e6ceb88a0ab015aeea9313f442aaab410532a1cceceb46

See more details on using hashes here.

Supported by

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