{"id":20518025,"url":"https://github.com/fridex/pip-preserve","last_synced_at":"2025-07-06T04:40:33.938Z","repository":{"id":148759181,"uuid":"620858836","full_name":"fridex/pip-preserve","owner":"fridex","description":"Output installed Python packages in requirements format, including also hashes of Python packages.","archived":false,"fork":false,"pushed_at":"2023-04-13T21:38:02.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T19:16:01.254Z","etag":null,"topics":["hacktoberfest-accepted","packaging","pep-710","pip","pip-freeze","python","requirements"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pip-preserve/","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/fridex.png","metadata":{"files":{"readme":"README.rst","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-29T14:07:40.000Z","updated_at":"2023-04-13T21:36:04.000Z","dependencies_parsed_at":"2023-05-28T21:15:43.121Z","dependency_job_id":null,"html_url":"https://github.com/fridex/pip-preserve","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fridex%2Fpip-preserve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fridex%2Fpip-preserve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fridex%2Fpip-preserve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fridex%2Fpip-preserve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fridex","download_url":"https://codeload.github.com/fridex/pip-preserve/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242123190,"owners_count":20075344,"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":["hacktoberfest-accepted","packaging","pep-710","pip","pip-freeze","python","requirements"],"created_at":"2024-11-15T21:38:12.532Z","updated_at":"2025-03-05T23:42:01.969Z","avatar_url":"https://github.com/fridex.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pip-preserve\n------------\n\nOutput installed Python packages in requirements format, including also hashes of Python packages\n\n.. note::\n\n  Note this tool requires pip with `PEP-710 \u003chttps://peps.python.org/pep-0710/\u003e`__ support which is a draft PEP as of today. See `this article \u003chttps://dev.to/fridex/how-to-get-information-about-the-provenance-of-python-packages-installed-4f65\u003e`__ and the FAQ section bellow.\n\nInstallation\n============\n\nThe tool can be `installed from GitHub \u003chttps://github.com/fridex/pip-preserve\u003e`__:\n\n.. code-block::\n\n  pip install git+https://github.com/fridex/pip-preserve.git\n\nYou can also consume the `published package on PyPI (recommended) \u003chttps://pypi.org/project/pip-preserve/\u003e`__:\n\n.. code-block::\n\n  pip install pip-preserve\n\nUsage\n=====\n\nAfter the installation process is successfully done, ``pip-preserve`` CLI\nis available:\n\n.. code-block::\n\n  pip-preserve --help\n\nBy default, the tool uses the current environment to find installed packages\nand reconstruct a ``requirements.txt`` file:\n\n.. code-block::\n\n  $ pip-preserve --ignore-errors\n  #\n  # This file is autogenerated by pip-preserve version 0.0.1 with Python 3.9.13.\n  #\n  click==8.1.3 \\\n    --hash=sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48\n  daiquiri==3.2.1 \\\n    --hash=sha256:b797a7ac94219dc26ef8ebf04f1f507eefa83a7d174e9eb41acc33e3ebf16f38\n  # micropipenv==1.5.0 installed using a direct URL\n  git+https://github.com/thoth-station/micropipenv@8176862ec96df23e152938659d6f45645246e398\n  packaging==23.0 \\\n    --hash=sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2\n  # pip==23.1.dev0 installed using a direct URL\n  file:///Users/user/git/fridex/pip\n  # pip-preserve==0.0.1 installed using a direct URL\n  -e file:///Users/user/git/fridex/pip-preserve\n  python-json-logger==2.0.7 \\\n    --hash=sha256:f380b826a991ebbe3de4d897aeec42760035ac760345e57b812938dc8b35e2bd\n\nIf you wish to obtain direct URLs of packages installed, you can pass\n``--direct-url`` flag:\n\n.. code-block::\n\n  $ pip-preserve --direct-url --ignore-errors\n  2023-04-05 12:36:26,168 [41348] WARNING  pip_preserve._lib: No provenance_url.json or direct_url.json found for 'setuptools' in version '58.1.0'\n  2023-04-05 12:36:26,168 [41348] WARNING  pip_preserve._lib: The generated output will miss information from '/Users/user/git/fridex/pip-preserve/.venv/lib/python3.9/site-packages/setuptools-58.1.0.dist-info', please review any missing packages in the output\n  #\n  # This file is autogenerated by pip-preserve version 0.0.1 with Python 3.9.13.\n  #\n  https://files.pythonhosted.org/packages/c2/f1/df59e28c642d583f7dacffb1e0965d0e00b218e0186d7858ac5233dce840/click-8.1.3-py3-none-any.whl \\\n    --hash=sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48\n  https://files.pythonhosted.org/packages/43/b0/b916172eee4e946dea7155ed969865c1b2c01c883101e33d1eb0c224a6a0/daiquiri-3.2.1-py3-none-any.whl \\\n    --hash=sha256:b797a7ac94219dc26ef8ebf04f1f507eefa83a7d174e9eb41acc33e3ebf16f38\n  # micropipenv==1.5.0 installed using a direct URL\n  git+https://github.com/thoth-station/micropipenv@8176862ec96df23e152938659d6f45645246e398\n  https://files.pythonhosted.org/packages/ed/35/a31aed2993e398f6b09a790a181a7927eb14610ee8bbf02dc14d31677f1c/packaging-23.0-py3-none-any.whl \\\n    --hash=sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2\n  # pip==23.1.dev0 installed using a direct URL\n  file:///Users/user/git/fridex/pip\n  # pip-preserve==0.0.1 installed using a direct URL\n  -e file:///Users/user/git/fridex/pip-preserve\n  https://files.pythonhosted.org/packages/35/a6/145655273568ee78a581e734cf35beb9e33a370b29c5d3c8fee3744de29f/python_json_logger-2.0.7-py3-none-any.whl \\\n    --hash=sha256:f380b826a991ebbe3de4d897aeec42760035ac760345e57b812938dc8b35e2bd\n\nIf the tool cannot determine from where a package was installed, it will fail.\nThis error can be ignored by supplying ``--ignore-errors`` flag. Any errors are\nturned into warnings that can be reviewed once the tool prints results.\n\nTo explicitly point to a ``site-packages`` directory, use the ``--site-packages``\noption.\n\nTo get more information about this tool, issue ``--help``.\n\nFAQ\n===\n\nQ: The tool fails or I'm getting warnings similar to the one below and my\noutput is missing some packages:\n\n.. code-block:: test\n\n  No provenance_url.json or direct_url.json found\n\nA: You most probably don't have pip with `PEP-710 support\n\u003chttps://peps.python.org/pep-0710/\u003e`__. Please install pip with PEP-710\nsupport, for example using `this patch\n\u003chttps://github.com/pypa/pip/pull/11865\u003e`__ (experimental):\n\n.. code-block::\n\n  pip install git+https://github.com/fridex/pip.git@provenance-url\n\nLicense\n=======\n\nSee the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffridex%2Fpip-preserve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffridex%2Fpip-preserve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffridex%2Fpip-preserve/lists"}