{ "info": { "author": "Bryce Boe", "author_email": "bbzbryce@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3.7" ], "description": "# deterministic_zip\n\nA tool to generate consistent zip files.\n\nThis tool was specifically built to prevent zip file changes from triggering\nAWS Lambda function updates when running `terraform apply`. Before this change,\nevery re-build of the zipfile would result in a different zip even if its\ncontents had not changed.\n\n## Requirements\n\nThis tool currently only runs on python3.7 in order to use deflate compression\nlevel 9.\n\n## Installation\n\n```sh\npip install deterministic_zip\n```\n\n## Creating a deterministic_zip\n\nRun the following, and verify that your zip produces the same sha256 hash:\n\n```sh\necho \"The first file.\" > first\necho \"The second file.\" > second\ndeterministic_zip archive.zip first second\nsha256sum archive.zip\n```\n\nIf you have `\\n` line endings the result should be:\n\n 3afbd7c9b42bd5539ffd5c40499d3d1825157ed83791dce8d7ff2694189d28d6\n\nIf you have `\\r\\n` line endings (Windows) the result should be:\n\n 40e16270d62f15e7a192e88b1b301fa6540c86e7e897036b56be513341d376ed\n\n\n## How does it work?\n\nGreat question! There are three tricks to building a deterministic zip.\n\n1) Files must be added to the zip in the same order. Directory iteration order\n may vary across machines, resulting in different zips. `deterministic_zip`\n sorts all files before adding them to the zip archive.\n\n2) Files in the zip must have consistent timestamps. If I share a directory to\n another machine, the timestamps of individual files may differ, depsite\n identical content. To achieve timestamp consistency, `deterministic_zip`\n sets the timestamp of all added files to `2019-01-01 00:00:00`. Please note\n that this __does not__ affect the timestamp of the source files.\n\n3) Files in the zip must have consistent permissions. File permissions look\n like `-rw-r--r--` for a file that is readable by all users, and only\n writable by the user who owns the file. Similarly executable files might\n have permissions that look like: `-rwxr-xr-x` or\n `-rwx------`. `deterministic_zip` sets the permission of all files to either\n `-r--r--r--`, or `-r-xr-xr-x`. The latter is only used of the user running\n `deterministic_zip` has execute access on the file.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bboe/deterministic_zip", "keywords": "aws lambda zip", "license": "Simplified BSD License", "maintainer": "", "maintainer_email": "", "name": "deterministic-zip", "package_url": "https://pypi.org/project/deterministic-zip/", "platform": "", "project_url": "https://pypi.org/project/deterministic-zip/", "project_urls": { "Homepage": "https://github.com/bboe/deterministic_zip" }, "release_url": "https://pypi.org/project/deterministic-zip/0.1/", "requires_dist": null, "requires_python": "", "summary": "A program to create deterministic zip files.", "version": "0.1" }, "last_serial": 4866448, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "638d96bb56b527ec07f74bef82c317f7", "sha256": "a16dc9fdfd130849e09adb5bc9c3e9ec8f3de109d405de04cb670cf73bb7c84a" }, "downloads": -1, "filename": "deterministic_zip-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "638d96bb56b527ec07f74bef82c317f7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4327, "upload_time": "2019-02-25T20:08:01", "url": "https://files.pythonhosted.org/packages/7a/29/7e6db311798cf302d28312673c8d0e79e4bfa3d1be7cc46b94a45589d564/deterministic_zip-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e3871b6c9705a683a40b9fb2e8fd4ff", "sha256": "d0095bafb65a7272ea9742c35d9fd3305dc5f1011b0f37addcf3fb95e7606100" }, "downloads": -1, "filename": "deterministic_zip-0.1.tar.gz", "has_sig": false, "md5_digest": "8e3871b6c9705a683a40b9fb2e8fd4ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3949, "upload_time": "2019-02-25T20:08:03", "url": "https://files.pythonhosted.org/packages/04/5a/297b8b79061e9ac3b1c23cc238c78c89bca8b07379864d37ef172fa182de/deterministic_zip-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "638d96bb56b527ec07f74bef82c317f7", "sha256": "a16dc9fdfd130849e09adb5bc9c3e9ec8f3de109d405de04cb670cf73bb7c84a" }, "downloads": -1, "filename": "deterministic_zip-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "638d96bb56b527ec07f74bef82c317f7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4327, "upload_time": "2019-02-25T20:08:01", "url": "https://files.pythonhosted.org/packages/7a/29/7e6db311798cf302d28312673c8d0e79e4bfa3d1be7cc46b94a45589d564/deterministic_zip-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e3871b6c9705a683a40b9fb2e8fd4ff", "sha256": "d0095bafb65a7272ea9742c35d9fd3305dc5f1011b0f37addcf3fb95e7606100" }, "downloads": -1, "filename": "deterministic_zip-0.1.tar.gz", "has_sig": false, "md5_digest": "8e3871b6c9705a683a40b9fb2e8fd4ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3949, "upload_time": "2019-02-25T20:08:03", "url": "https://files.pythonhosted.org/packages/04/5a/297b8b79061e9ac3b1c23cc238c78c89bca8b07379864d37ef172fa182de/deterministic_zip-0.1.tar.gz" } ] }