{"id":16759424,"url":"https://github.com/victorfsf/pickleclip","last_synced_at":"2025-04-10T17:14:59.147Z","repository":{"id":57452506,"uuid":"91806241","full_name":"victorfsf/pickleclip","owner":"victorfsf","description":"Simple clipboard tool for Python pickled objects.","archived":false,"fork":false,"pushed_at":"2020-10-05T14:58:52.000Z","size":28,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T15:02:40.468Z","etag":null,"topics":["clip","clipboard","pickle","pickleclip"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/victorfsf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-19T13:00:59.000Z","updated_at":"2025-01-13T16:05:43.000Z","dependencies_parsed_at":"2022-08-30T01:10:25.922Z","dependency_job_id":null,"html_url":"https://github.com/victorfsf/pickleclip","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorfsf%2Fpickleclip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorfsf%2Fpickleclip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorfsf%2Fpickleclip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorfsf%2Fpickleclip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victorfsf","download_url":"https://codeload.github.com/victorfsf/pickleclip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247878022,"owners_count":21011158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clip","clipboard","pickle","pickleclip"],"created_at":"2024-10-13T04:08:05.929Z","updated_at":"2025-04-10T17:14:59.112Z","avatar_url":"https://github.com/victorfsf.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pickleclip\n\n[![PyPI version](https://badge.fury.io/py/pickleclip.svg)](https://badge.fury.io/py/pickleclip)\n[![Build Status](https://circleci.com/gh/victorfsf/pickleclip/tree/master.svg?style=shield)](https://circleci.com/gh/victorfsf/pickleclip)\n[![Coverage Status](https://coveralls.io/repos/github/victorfsf/pickleclip/badge.svg)](https://coveralls.io/github/victorfsf/pickleclip)\n[![Code Health](https://landscape.io/github/victorfsf/pickleclip/master/landscape.svg?style=flat)](https://landscape.io/github/victorfsf/pickleclip/master)\n\n*A Simple clipboard tool for Python (2.7+ and 3.4+) pickled objects.*\n\n## Installation\n\nIf you're using **Linux**, be sure to install [pyperclip](https://github.com/asweigart/pyperclip)'s dependency, xclip:\n```\nsudo apt-get install xclip\n```\n\nThen, install via pip:\n```\npip install pickleclip\n```\n\n## Usage:\n\nUsing `pickleclip` is as simple as copying and pasting text:\n\n```python\nIn [1]: import pickleclip as picklec\n\nIn [2]: picklec.copy({'hello': 'world'})\n\nIn [3]: picklec.paste()\nOut[3]: {'hello': 'world'}\n```\n\nTo copy functions or any object that the native pickle package can't handle, use dillcopy/dillpaste (it'll use [dill](https://github.com/uqfoundation/dill) instead of pickle):\n\n```python\nIn [1]: import pickleclip as picklec\n\nIn [2]: def add(x, y):\n   ...:     return x + y\n\nIn [3]: picklec.dillcopy(add)\n\nIn [4]: picklec.dillpaste()\nOut[4]: \u003cfunction __main__.add\u003e\n\nIn [5]: picklec.dillpaste()(5, 10)\nOut[5]: 15\n```\n\nPickleclip will copy any python object supported by pickle (or dill) into your clipboard. You can paste it anywhere you'd like (in another shell, for instance), as long as you use the `pickleclip.paste` function.\n\n### Copying from Python 3 to Python 2 using pickle\n\nTo get Python 3 objects to unpickle on Python 2, specify `protocol=2` when copying. Although pickle will try to map the new Python 3 names to the old module names used in Python 2, so that the pickle data stream is readable with Python 2, this does not come without limitations.\n\nGoing from Python 2 to Python 3 is even less trivial, and will mostly only work for the simplest cases. See also [pickle-compat](https://pypi.org/project/pickle-compat/).\n\nBy default, the highest [pickle protocol](https://docs.python.org/3/library/pickle.html#pickle-protocols) available to the interpreter is used. The higher the protocol used, the more recent the version of Python needed to read the pickle produced.\n\n##### Python 3 shell:\n\n```python\nIn [1]: import pickleclip as picklec\n\nIn [2]: picklec.copy({'hello': 'world'}, protocol=2)\n```\n\n##### Python 2 shell:\n\n```python\nIn [1]: import pickleclip as picklec\n\nIn [2]: picklec.paste()\nOut[2]: {'hello': 'world'}\n```\n\n### Copying from different Python versions using dill\n\nIt should work fine with basic objects (str, int, float, list, set, dict...), but it won't work with nothing too \"fancy\", (functions, custom objects...).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorfsf%2Fpickleclip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictorfsf%2Fpickleclip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorfsf%2Fpickleclip/lists"}