{"id":37073396,"url":"https://github.com/quarkslab/python-zipstream","last_synced_at":"2026-01-14T08:36:57.602Z","repository":{"id":57426400,"uuid":"162269915","full_name":"quarkslab/python-zipstream","owner":"quarkslab","description":"forked from allanlei/python-zipstream","archived":false,"fork":false,"pushed_at":"2019-01-02T13:04:20.000Z","size":59,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-25T16:51:34.862Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quarkslab.png","metadata":{"files":{"readme":"README.markdown","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":"2018-12-18T10:20:13.000Z","updated_at":"2024-10-13T07:40:10.000Z","dependencies_parsed_at":"2022-09-11T04:22:25.838Z","dependency_job_id":null,"html_url":"https://github.com/quarkslab/python-zipstream","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/quarkslab/python-zipstream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkslab%2Fpython-zipstream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkslab%2Fpython-zipstream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkslab%2Fpython-zipstream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkslab%2Fpython-zipstream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quarkslab","download_url":"https://codeload.github.com/quarkslab/python-zipstream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkslab%2Fpython-zipstream/sbom","scorecard":{"id":755322,"data":{"date":"2025-08-11","repo":{"name":"github.com/quarkslab/python-zipstream","commit":"f4eff20e74082414996fdfada97a5ff7fc7b60aa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":10,"reason":"no binaries found in the repo","details":null,"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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: 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":"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":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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"}}]},"last_synced_at":"2025-08-22T21:31:04.835Z","repository_id":57426400,"created_at":"2025-08-22T21:31:04.835Z","updated_at":"2025-08-22T21:31:04.835Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:31:27.429Z","status":"ssl_error","status_checked_at":"2026-01-14T08:31:19.098Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-14T08:36:56.809Z","updated_at":"2026-01-14T08:36:57.589Z","avatar_url":"https://github.com/quarkslab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Enczipstream\n\n[![Build Status](https://travis-ci.org/ch0k0bn/python-zipstream.png?branch=master)](https://travis-ci.org/ch0k0bn/python-zipstream)\n\n## Original Authors and Weak algorithm warning\n\nenczipstream is the merge between allanlei's [python-zipstream](https://github.com/allanlei/python-zipstream) and\ndevthat's [zipencrypt](https://github.com/devthat/zipencrypt/tree/master/zipencrypt) allowing a user to stream password\nprotected archive (with the weak algorithm)\n\nWEAK ALGORITHM IS NOT SECURE\n\n## Readme\n\n\nenczipstream.py is a zip archive generator based on python 3.3's zipfile.py. It was created to\ngenerate a zip file generator for streaming (ie web apps). This is beneficial for when you\nwant to provide a downloadable archive of a large collection of regular files, which would be infeasible to\ngenerate the archive prior to downloading or of a very large file that you do not want to store entirely on disk or on memory.\n\nThe archive is generated as an iterator of strings, which, when joined, form\nthe zip archive. For example, the following code snippet would write a zip\narchive containing files from 'path' to a normal file:\n\n```python\nimport enczipstream\n\nz = enczipstream.ZipFile()\nz.write('path/to/files')\n\nwith open('zipfile.zip', 'wb') as f:\n    for data in z:\n        f.write(data)\n```\n\nenczipstream also allows to take as input a byte string iterable and to generate\nthe archive as an iterator.\nThis avoids storing large files on disk or in memory.\nTo do so you could use something like this snippet:\n\n```python\ndef iterable():\n    for _ in xrange(10):\n        yield b'this is a byte string\\x01\\n'\n\nz = enczipstream.ZipFile()\nz.write_iter('my_archive_iter', iterable())\n\nwith open('zipfile.zip', 'wb') as f:\n    for data in z:\n        f.write(data)\n```\n\nOf course both approach can be combined:\n\n```python\ndef iterable():\n    for _ in xrange(10):\n        yield b'this is a byte string\\x01\\n'\n\nz = enczipstream.ZipFile()\nz.write('path/to/files', 'my_archive_files')\nz.write_iter('my_archive_iter', iterable())\n\nwith open('zipfile.zip', 'wb') as f:\n    for data in z:\n        f.write(data)\n```\n\nSince recent versions of web.py support returning iterators of strings to be\nsent to the browser, to download a dynamically generated archive, you could\nuse something like this snippet:\n\n```python\ndef GET(self):\n    path = '/path/to/dir/of/files'\n    zip_filename = 'files.zip'\n    web.header('Content-type' , 'application/zip')\n    web.header('Content-Disposition', 'attachment; filename=\"%s\"' % (\n        zip_filename,))\n    return enczipstream.ZipFile(path)\n```\n\nIf the zlib module is available, enczipstream.ZipFile can generate compressed zip\narchives.\n\n## Installation\n\n```\npip install enczipstream\n```\n\n## Requirements\n\n  * Python 2.6, 2.7, 3.2, 3.3, pypy\n\n## Examples\n\n### flask\n\n```python\nfrom flask import Response\n\n@app.route('/package.zip', methods=['GET'], endpoint='zipball')\ndef zipball():\n    def generator():\n        z = enczipstream.ZipFile(mode='w', compression=ZIP_DEFLATED)\n\n        z.write('/path/to/file')\n\n        for chunk in z:\n            yield chunk\n\n    response = Response(generator(), mimetype='application/zip')\n    response.headers['Content-Disposition'] = 'attachment; filename={}'.format('files.zip')\n    return response\n\n# or\n\n@app.route('/package.zip', methods=['GET'], endpoint='zipball')\ndef zipball():\n    z = enczipstream.ZipFile(mode='w', compression=ZIP_DEFLATED)\n    z.write('/path/to/file')\n\n    response = Response(z, mimetype='application/zip')\n    response.headers['Content-Disposition'] = 'attachment; filename={}'.format('files.zip')\n    return response\n```\n\n### django 1.5+\n\n```python\nfrom django.http import StreamingHttpResponse\n\ndef zipball(request):\n    z = enczipstream.ZipFile(mode='w', compression=ZIP_DEFLATED)\n    z.write('/path/to/file')\n\n    response = StreamingHttpResponse(z, content_type='application/zip')\n    response['Content-Disposition'] = 'attachment; filename={}'.format('files.zip')\n    return response\n```\n\n### webpy\n\n```python\ndef GET(self):\n    path = '/path/to/dir/of/files'\n    zip_filename = 'files.zip'\n    web.header('Content-type' , 'application/zip')\n    web.header('Content-Disposition', 'attachment; filename=\"%s\"' % (\n        zip_filename,))\n    return enczipstream.ZipFile(path)\n```\n\n### password example\n\n```python\ndef iterable():\n    for _ in xrange(10):\n        yield b'this is a byte string\\x01\\n'\n\nz = enczipstream.ZipFile(mode='w',\n                         compression=enczipstream.ZIP_DEFLATED,\n                         pwd=b\"correct horse battery staple\")\nz.write_iter('my_archive_iter', iterable())\n```\n\n## Running tests\n\nWith python version \u003e 2.6, just run the following command: `python -m unittest discover`\n\nAlternatively, you can use `nose`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquarkslab%2Fpython-zipstream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquarkslab%2Fpython-zipstream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquarkslab%2Fpython-zipstream/lists"}