{"id":13725068,"url":"https://github.com/miurahr/py7zr","last_synced_at":"2025-11-12T21:29:56.886Z","repository":{"id":34676644,"uuid":"176052188","full_name":"miurahr/py7zr","owner":"miurahr","description":"7zip in python3 with ZStandard, PPMd, LZMA2, LZMA1, Delta, BCJ, BZip2, and Deflate compressions, and AES encryption.","archived":false,"fork":false,"pushed_at":"2025-11-10T23:27:54.000Z","size":48563,"stargazers_count":517,"open_issues_count":39,"forks_count":86,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-11-12T21:29:48.479Z","etag":null,"topics":["7-zip","7zip","aes","bcj","bzip2","cli","compress","decompression","decryption","deflate","encryption","library","lzma","lzma2","ppmd","python","zstandard"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/py7zr/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miurahr.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.rst","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY.rst","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":"miurahr","issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-03-17T03:33:35.000Z","updated_at":"2025-11-10T23:19:49.000Z","dependencies_parsed_at":"2023-01-15T08:31:15.226Z","dependency_job_id":"c033b846-cd98-4282-bdcb-bb7e1df90b39","html_url":"https://github.com/miurahr/py7zr","commit_stats":{"total_commits":1411,"total_committers":31,"mean_commits":"45.516129032258064","dds":"0.030474840538625037","last_synced_commit":"afa99519193b902b37c144d6a0cc13367edbd3c5"},"previous_names":[],"tags_count":171,"template":false,"template_full_name":null,"purl":"pkg:github/miurahr/py7zr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miurahr%2Fpy7zr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miurahr%2Fpy7zr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miurahr%2Fpy7zr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miurahr%2Fpy7zr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miurahr","download_url":"https://codeload.github.com/miurahr/py7zr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miurahr%2Fpy7zr/sbom","scorecard":{"id":142592,"data":{"date":"2025-08-11","repo":{"name":"github.com/miurahr/py7zr","commit":"2cafe61e6b6d04e6bdfbe0399e31ef8dea610e48"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.6,"checks":[{"name":"Maintained","score":10,"reason":"13 commit(s) and 7 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: docs/SECURITY.rst:1","Info: Found linked content: docs/SECURITY.rst:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: docs/SECURITY.rst:1","Info: Found text in security policy: docs/SECURITY.rst:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Code-Review","score":5,"reason":"Found 9/17 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":7,"reason":"binaries present in source code","details":["Warn: binary detected: tests/data/lib/aarch64-linux-gnu/liblzma.so.0:1","Warn: binary detected: tests/data/lib/powerpc64le-linux-gnu/liblzma.so.0:1","Warn: binary detected: utils/codacy-coverage-reporter.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:19","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:20","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/publish-to-pypi.yml:1","Warn: no topLevel permission defined: .github/workflows/release-note.yml:1","Warn: no topLevel permission defined: .github/workflows/run-benchmark.yml:1","Warn: no topLevel permission defined: .github/workflows/run-linter.yml:1","Warn: no topLevel permission defined: .github/workflows/run-tox-tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v2.1: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-to-pypi.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/publish-to-pypi.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-to-pypi.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/publish-to-pypi.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-to-pypi.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/publish-to-pypi.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-to-pypi.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/publish-to-pypi.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-note.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/release-note.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-note.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/release-note.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-note.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/release-note.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-benchmark.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-benchmark.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-benchmark.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-benchmark.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-linter.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-linter.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-linter.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-linter.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-linter.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-linter.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-linter.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-linter.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tox-tests.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-tox-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tox-tests.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-tox-tests.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/run-tox-tests.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-tox-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tox-tests.yml:89: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-tox-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tox-tests.yml:105: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-tox-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tox-tests.yml:109: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-tox-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tox-tests.yml:133: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-tox-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tox-tests.yml:137: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-tox-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tox-tests.yml:170: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-tox-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tox-tests.yml:179: update your workflow using https://app.stepsecurity.io/secureworkflow/miurahr/py7zr/run-tox-tests.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/publish-to-pypi.yml:27","Warn: pipCommand not pinned by hash: .github/workflows/run-benchmark.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/run-benchmark.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/run-benchmark.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/run-linter.yml:51","Warn: pipCommand not pinned by hash: .github/workflows/run-linter.yml:30","Warn: pipCommand not pinned by hash: .github/workflows/run-linter.yml:31","Warn: pipCommand not pinned by hash: .github/workflows/run-tox-tests.yml:63","Warn: pipCommand not pinned by hash: .github/workflows/run-tox-tests.yml:64","Warn: pipCommand not pinned by hash: .github/workflows/run-tox-tests.yml:119","Warn: pipCommand not pinned by hash: .github/workflows/run-tox-tests.yml:120","Warn: pipCommand not pinned by hash: .github/workflows/run-tox-tests.yml:147","Warn: pipCommand not pinned by hash: .github/workflows/run-tox-tests.yml:148","Info:   0 out of  23 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   5 third-party GitHubAction dependencies pinned","Info:   0 out of  13 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish-to-pypi.yml:38"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":9,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 22 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T08:31:43.545Z","repository_id":34676644,"created_at":"2025-08-16T08:31:43.545Z","updated_at":"2025-08-16T08:31:43.545Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284115869,"owners_count":26949957,"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","status":"online","status_checked_at":"2025-11-12T02:00:06.336Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["7-zip","7zip","aes","bcj","bzip2","cli","compress","decompression","decryption","deflate","encryption","library","lzma","lzma2","ppmd","python","zstandard"],"created_at":"2024-08-03T01:02:11.665Z","updated_at":"2025-11-12T21:29:56.880Z","avatar_url":"https://github.com/miurahr.png","language":"Python","funding_links":["https://liberapay.com/miurahr"],"categories":["Python"],"sub_categories":[],"readme":"======================================\n|logo| py7zr -- a 7z library on python\n======================================\n\n.. |logo| image:: logo.svg\n    :width: 80pt\n    :height: 80pt\n    :target: https://pypi.org/project/py7zr\n\n.. image:: https://readthedocs.org/projects/py7zr/badge/?version=latest\n  :target: https://py7zr.readthedocs.io/en/latest/?badge=latest\n\n.. image:: https://badge.fury.io/py/py7zr.svg\n  :target: https://badge.fury.io/py/py7zr\n\n.. image:: https://img.shields.io/pypi/dd/py7zr\n  :target: https://pypi.org/project/py7zr\n\n.. image:: https://img.shields.io/conda/vn/conda-forge/py7zr\n  :target: https://anaconda.org/conda-forge/py7zr\n\n.. image:: https://github.com/miurahr/py7zr/workflows/Run%20Tox%20tests/badge.svg\n  :target: https://github.com/miurahr/py7zr/actions\n\n.. image:: https://dev.azure.com/miurahr/github/_apis/build/status/miurahr.py7zr?branchName=master\n  :target: https://dev.azure.com/miurahr/github/_build/latest?definitionId=14\u0026branchName=master\n\n.. image:: https://coveralls.io/repos/github/miurahr/py7zr/badge.svg?branch=master\n  :target: https://coveralls.io/github/miurahr/py7zr?branch=master\n\n.. image:: https://img.shields.io/pypi/l/py7zr\n  :target: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html\n  \n.. image:: https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg\n  :target: https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md\n  \n.. image:: https://snyk.io/advisor/python/py7zr/badge.svg\n  :target: https://snyk.io/advisor/python/py7zr\n  :alt: py7zr\n  \n.. image:: https://app.codacy.com/project/badge/Grade/d9d82e1c1708470a921a3a974ea0eedd\n  :target: https://app.codacy.com/gh/miurahr/py7zr/dashboard\n  :alt: Codacy\n\n\npy7zr is a library and utility to support 7zip archive compression, decompression,\nencryption and decryption written by Python programming language.\n\nIncompatible change\n===================\n\nThere is incompatible change between v1.0.0-rc1 to v1.0.0-rc2.\nI abandon methods ``read`` and ``readall``.\nWhen you want to extract the archive to memory, you need to use\n``extract`` method with ``factory`` argument. The ``factory`` takes a factory class, as of the GoF design pattern,\nthat provides object implements ``Py7zIO`` interface as a call back instance.\n``SevenZipFile`` extract and write uncompressed data into your ``Py7zIO`` object.\n\nDiscussion Forum\n================\n\nYou are welcome to join discussions on project forum/builtin-board at\nhttps://github.com/miurahr/py7zr/discussions\n\nYou can see announcements of new releases, questions and answers, and\nnew feature ideas. When you doubt for usage of py7zr library with unclear\nmanuals, please feel easy to raise question on forum.\n\nCompression algorithms\n======================\n\n``py7zr`` supports algorithms and filters which `lzma module`_ and `liblzma`_ support,\nand supports BZip2 and Deflate that are implemented in python core libraries,\nIt also supports ZStandard, Brotli and PPMd with third party libraries.\n\n``py7zr`` is also able to encrypt and decrypt data using 3rd party encryption library.\n\n\nSupported algorithms\n--------------------\n\n* compress\n    * LZMA2\n    * LZMA\n    * Bzip2\n    * Deflate\n    * Copy\n    * ZStandard\n    * Brotli\n    * PPMd\n    * Enhanced Deflate (Experimental)\n\n* crypt\n    * 7zAES\n\n* Filters\n    * Delta\n    * BCJ(X86,ARMT,ARM,PPC,SPARC,IA64)\n\n.. note::\n  * A feature handling symbolic link is basically compatible with ``p7zip`` implementation,\n    but not work with original 7-zip because the original does not implement the feature.\n  * ``py7zr`` try checking symbolic links strictly and raise ValueError when bad link is requested,\n    but it does **not** guarantee to block all the bad cases.\n  * ZStandard and Brotli is not default methods of 7-zip, so these archives are considered\n    not to be compatible with original 7-zip on windows/p7zip on linux/mac.\n  * Enhanced Deflate is also known as ``DEFLATE64`` :sup:`TM` that is a registered trademark of ``PKWARE, Inc.``\n  * Enhanced Deflate is tested only on CPython. It is disabled on PyPy.\n\nNot supported algorithms\n------------------------\n\n* BCJ2 (Standard `lzma module`_ does not provide).\n\n\nInstall\n=======\n\nYou can install py7zr as usual other libraries using pip.\n\n.. code-block:: shell\n\n    $ pip install py7zr\n\nOR, alternatively using conda:\n\n.. code-block:: shell\n\n    $ conda install -c conda-forge py7zr\n\nDocuments\n=========\n\nUser manuals\n------------\n\n* `User Guide`_ for latest version.\n\n* `API Guide`_ for latest version.\n\n* `Manual`_ for stable version.\n\nDeveloper guide\n---------------\n\n* `Contribution guidelines`_ for this project.\n\n* `Contribution guidelines(html)`_  for this project.\n\n* `Code of conduct`_ for this project.\n\n* `Code of conduct(html)`_ for this project.\n\n* `7z file specification`_ that py7zr stand on.\n\n\n.. _`User Guide`: https://py7zr.readthedocs.io/en/latest/user_guide.html\n\n.. _`API Guide` : https://py7zr.readthedocs.io/en/latest/api.html\n\n.. _`Manual` : https://py7zr.readthedocs.io/en/stable/\n\n.. _`Contribution guidelines(html)` : https://py7zr.readthedocs.io/en/latest/contribution.html\n\n.. _`Contribution guidelines` : docs/contribution.rst\n\n.. _`Code  of conduct` : docs/CODE_OF_CONDUCT.rst\n\n.. _`Code  of conduct(html)` : https://py7zr.readthedocs.io/en/latest/CODE_OF_CONDUCT.html\n\n.. _`7z file specification` : https://py7zr.readthedocs.io/en/latest/archive_format.html\n\n\nCLI Usage\n=========\n\nYou can run command script py7zr like as follows;\n\n* List archive contents\n\n.. code-block:: shell\n\n    $ py7zr l test.7z\n\n* Extract archive\n\n.. code-block:: shell\n\n    $ py7zr x test.7z\n\n* Extract archive with password\n\n.. code-block:: shell\n\n    $ py7zr x -P test.7z\n      password?: ****\n\n* Create and compress to archive\n\n.. code-block:: shell\n\n    $ py7zr c target.7z test_dir\n\n* Create multi-volume archive\n\n.. code-block:: shell\n\n    $ py7zr c -v 500k target.7z test_dir\n\n* Test archive\n\n.. code-block:: shell\n\n    $ py7zr t test.7z\n\n* Append files to archive\n\n.. code-block:: shell\n\n    $ py7zr a test.7z test_dir\n\n* Show information\n\n.. code-block:: shell\n\n    $ py7zr i\n\n* Show version\n\n.. code-block:: shell\n\n    $ py7zr --version\n\n\nSevenZipFile Class Usage\n========================\n\npy7zr is a library which can use in your python application.\n\nDecompression/Decryption\n------------------------\n\nHere is a code snippet how to decompress some file in your application.\n\n.. code-block:: python\n\n    import py7zr\n\n    archive = py7zr.SevenZipFile('sample.7z', mode='r')\n    archive.extractall(path=\"/tmp\")\n    archive.close()\n\n\n\nYou can also use 'with' block because py7zr provide context manager(v0.6 and later).\n\n.. code-block:: python\n\n    import py7zr\n\n    with py7zr.SevenZipFile('sample.7z', mode='r') as z:\n        z.extractall()\n\n    with py7zr.SevenZipFile('target.7z', 'w') as z:\n        z.writeall('./base_dir')\n\n\n``py7zr`` also supports extraction of single or selected files by 'extract(targets=['file path'])'.\nNote: if you specify only a file but not a parent directory, it will fail.\n\n.. code-block:: python\n\n    import py7zr\n    import re\n\n    filter_pattern = re.compile(r'\u003cyour/target/file_and_directories/regex/expression\u003e')\n    with py7zr.SevenZipFile('archive.7z', 'r') as archive:\n        allfiles = archive.getnames()\n        selective_files = [f for f in allfiles if filter_pattern.match(f)]\n        archive.extract(targets=selective_files)\n\n\npy7zr support an extraction of password protected archive.(v0.6 and later)\n\n.. code-block:: python\n\n    import py7zr\n\n    with py7zr.SevenZipFile('encrypted.7z', mode='r', password='secret') as z:\n        z.extractall()\n\nCompression/Encryption\n----------------------\n\nHere is a code snippet how to produce archive.\n\n.. code-block:: python\n\n    import py7zr\n\n    with py7zr.SevenZipFile('target.7z', 'w') as archive:\n        archive.writeall('/path/to/base_dir', 'base')\n\n\nTo create encrypted archive, please pass a password.\n\n.. code-block:: python\n\n    import py7zr\n\n    with py7zr.SevenZipFile('target.7z', 'w', password='secret') as archive:\n        archive.writeall('/path/to/base_dir', 'base')\n\n\nTo create archive with algorithms such as zstandard, you can call with custom filter.\n\n.. code-block:: python\n\n    import py7zr\n\n    my_filters = [{\"id\": py7zr.FILTER_ZSTD}]\n    another_filters = [{\"id\": py7zr.FILTER_ARM}, {\"id\": py7zr.FILTER_LZMA2, \"preset\": 7}]\n    with py7zr.SevenZipFile('target.7z', 'w', filters=my_filters) as archive:\n        archive.writeall('/path/to/base_dir', 'base')\n\n\nshutil helper\n=============\n\npy7zr also support `shutil`  interface.\n\n.. code-block:: python\n\n    from py7zr import pack_7zarchive, unpack_7zarchive\n    import shutil\n\n    # register file format at first.\n    shutil.register_archive_format('7zip', pack_7zarchive, description='7zip archive')\n    shutil.register_unpack_format('7zip', ['.7z'], unpack_7zarchive)\n\n    # extraction\n    shutil.unpack_archive('test.7z', '/tmp')\n\n    # compression\n    shutil.make_archive('target', '7zip', 'src')\n\n\nRequirements\n============\n\n`py7zr` uses a python3 standard `lzma module`_ for extraction and compression.\nThe standard lzma module uses `liblzma`_ that support core compression algorithm of 7zip.\n\nMinimum required version is Python 3.9.\n\n``py7zr`` tested on Linux, macOS, Windows and Ubuntu aarch64.\n\nIt hopefully works on M1 Mac too.\n\nRecommended versions are:\n\n- CPython 3.9.0 and later.\n- PyPy3.9-7.3.8 and later.\n\nFollowing fixes are included in these versions, and it is not fixed on python3.6.\n\n- `BPO-21872`_: LZMA library sometimes fails to decompress a file\n- `PyPy3-3090`_: lzma.LZMADecomporessor.decompress does not respect max_length\n- `PyPy3-3242`_: '_lzma_cffi' has no function named 'lzma_stream_encoder'\n\nFollowing improvements are included in CPython 3.10\n\n- `BPO-41486`_: Faster bz2/lzma/zlib via new output buffering\n\n.. _`lzma module`: https://docs.python.org/3/library/lzma.html\n.. _`liblzma`: https://tukaani.org/xz/\n.. _`BPO-21872`: https://bugs.python.org/issue21872\n.. _`BPO-41486`: https://bugs.python.org/issue41486\n.. _`PyPy3-3090`: https://foss.heptapod.net/pypy/pypy/-/issues/3090\n.. _`PyPy3-3242`: https://foss.heptapod.net/pypy/pypy/-/issues/3242\n\n\n\nDependencies\n============\n\nThere are several dependencies to support algorithms and CLI expressions.\n\n===================== ===============================\nPackage               Purpose\n===================== ===============================\n`PyCryptodomex`_      7zAES encryption\n`backports.zstd`      ZStandard compression for Python before 3.14\n`PyPPMd`_             PPMd compression\n`Brotli`_             Brotli compression (CPython)\n`BrotliCFFI`_         Brotli compression (PyPy)\n`inflate64`_          Enhanced deflate compression\n`pybcj`_              BCJ filters\n`multivolumefile`_    Multi-volume archive read/write\n`texttable`_          CLI formatter\n===================== ===============================\n\n\n.. _`Pycryptodomex` : https://www.pycryptodome.org/en/latest/index.html\n.. _`backports.zstd` : https://pypi.org/project/backports.zstd\n.. _`PyPPMd` : https://pypi.org/project/pyppmd\n.. _`Brotli` : https://pypi.org/project/brotli\n.. _`BrotliCFFI` : https://pypi.org/project/brotlicffi\n.. _`inflate64` : https://pypi.org/project/inflate64\n.. _`pybcj` : https://pypi.org/project/pybcj\n.. _`multivolumefile` : https://pypi.org/project/multivolumefile\n.. _`texttable` : https://pypi.org/project/texttable\n\n\nPerformance\n===========\n\nYou can find a compression and decompression benchmark results at\n[Github issue](https://github.com/miurahr/py7zr/issues/297) and [wiki page](https://github.com/miurahr/py7zr/wiki/Benchmarks)\n\npy7zr works well, but slower than ``7-zip`` and ``p7zip`` C/C++ implementation by several reasons.\nWhen compression/decompression **speed** is important, it is recommended to use these\nalternatives through ``subprocess.run`` python interface.\n\npy7zr consumes some memory to decompress and compress data. It requires about 300MiB - 700MiB free memory to work well at least.\n\n\nUse Cases\n=========\n\n- `PyTorch`_  Open-source deep learning framework.\n- `aqtinstall`_ Another (unofficial) Qt (aqt) CLI Installer on multi-platforms.\n- PreNLP_ Preprocessing Library for Natural Language Processing\n- mlox_  a tool for sorting and analyzing Morrowind plugin load order\n\n.. _`PyTorch`: https://pytorch.org/\n.. _aqtinstall: https://github.com/miurahr/aqtinstall\n.. _PreNLP: https://github.com/lyeoni/prenlp\n.. _mlox: https://github.com/mlox/mlox\n\nSecurity\n========\n\nPlease find a `Security Policy`_ of this project.\n\nVersion 0.20.0, 0.19.0, 0.18.10 or before has a `vulnerability for path traversal`_  attack.\nDetails are on \"CVE-2022-44900: path traversal vulnerability in py7zr\" `disclose article`_ .\n\nAffected versions  are vulnerable to Directory Traversal due to insufficient checks in the 'py7zr.py' and 'helpers.py' files\n\nYou are recommend to update immediately to version 0.20.2 or later\n\n.. _`vulnerability for path traversal`: https://security.snyk.io/vuln/SNYK-PYTHON-PY7ZR-3092461\n\nI really appreciate Mr. Matteo Cosentino for notification and corporation on security improvement.\n\n.. _`disclose article`: https://lessonsec.com/cve/cve-2022-44900/\n\n.. _`Security Policy` : https://py7zr.readthedocs.io/en/latest/SECURITY.html\n\nLicense\n=======\n\n* Copyright (C) 2019-2024 Hiroshi Miura\n\n* pylzma Copyright (c) 2004-2015 by Joachim Bauch\n* 7-Zip Copyright (C) 1999-2010 Igor Pavlov\n* LZMA SDK Copyright (C) 1999-2010 Igor Pavlov\n\nThis library is free software; you can redistribute it and/or\nmodify it under the terms of the GNU Lesser General Public\nLicense as published by the Free Software Foundation; either\nversion 2.1 of the License, or (at your option) any later version.\n\nThis library is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this library; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiurahr%2Fpy7zr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiurahr%2Fpy7zr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiurahr%2Fpy7zr/lists"}