Skip to main content

Reproducible ZipFile (supports shutil.archive)

Project description

Reproducible / Deterministic ZipFiles

A tool to generate consistent zip files.

Installation

pip install reproducible_zip

Usage

The module uses the same interface as the python builtin zipfile module:

python -m reproducible_zip

How does it work?

There are four tricks to building a deterministic zip:

  1. Files must be added to the zip in the same order. rzip sorts all directories and files (with directories first) before adding them to the zip archive.

  2. Files in the zip must have consistent timestamps. The timestamp of files and directories is set to the minimum timestamp for zipfiles: 1980-01-01 00:00:00.

  3. Files in the zip must have consistent permissions. All permission bits are set -rwxrwxrwx for files and drwxrwxrwx for directories.

  4. The "create system" for all files is set to "unix-like" (3) to ensure the correct intrepretation of the external_attrs/permissons.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reproducible_zip-0.2.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reproducible_zip-0.2.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file reproducible_zip-0.2.0.tar.gz.

File metadata

  • Download URL: reproducible_zip-0.2.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for reproducible_zip-0.2.0.tar.gz
Algorithm Hash digest
SHA256 203d4b13ce1e8daf77fe354a6f87dc826273555e5ceb0d95200358de75dbf4c6
MD5 c3e7ddbc20477fdabb0bfa0e44aa34a3
BLAKE2b-256 9bc7b863a3cbe5ae0681021e26a0fa350a2998f607e71b016baa31bf40e35282

See more details on using hashes here.

File details

Details for the file reproducible_zip-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for reproducible_zip-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c8f03301515f9250802a1f042139fed6ef4ae0a3615c7913afe51c2690c385f
MD5 ef46c152771d78468ea8589fba85bdf7
BLAKE2b-256 3d52f8b0a8236e527014856b4d6523d2e263a17fe7a17ce8bbd1ac3cb2b2ad04

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page