{
  "id": "python-zipfile-table",
  "kind": "table",
  "slug": "python-zipfile",
  "iil_id": null,
  "note_url": "https://iinventedlight.com/library/notes/python-zipfile/",
  "title": "Python zipfile - create, read, append and safely extract ZIP archives",
  "columns": [
    "name",
    "source",
    "detail"
  ],
  "rows": [
    {
      "name": "'r' / 'w' / 'a' / 'x'",
      "source": "Python docs",
      "detail": "read, truncate and write, append, or create exclusively"
    },
    {
      "name": "ZIP_STORED",
      "source": "Python docs",
      "detail": "uncompressed archive member (the default)"
    },
    {
      "name": "ZIP_DEFLATED",
      "source": "Python docs",
      "detail": "the usual ZIP compression method; requires zlib"
    },
    {
      "name": "ZIP_BZIP2 / ZIP_LZMA",
      "source": "Python docs",
      "detail": "need the bz2 or lzma module"
    },
    {
      "name": "namelist()",
      "source": "Python docs",
      "detail": "returns a list of archive members by name; open(name) gives a binary file-like object."
    },
    {
      "name": "writestr(name, data)",
      "source": "Python docs",
      "detail": "writes a str or bytes; a str is encoded as UTF-8 first."
    }
  ],
  "related_slugs": [
    "python-pathlib",
    "python-read-write-files"
  ],
  "license": "CC-BY-4.0",
  "source_license": "PSF-2.0 (Python docs); PSF-2.0 (python/cpython (GitHub)); prose restates cited source lines in own words",
  "as_of": "2026-11-18",
  "status": "fill-draft-20261118",
  "note": "Restated from the note's GREEN sources; check those sources before relying on a value."
}