zipapp: build executable zip archives of Python code
Answer: This module provides tools to manage zip files containing Python code. Those archives can be executed directly by the Python interpreter. The --main option writes a __main__.py file to the archive that executes mainfn.
Executable zip archives
This module provides tools to manage zip files containing Python code.
Those archives can be executed directly by the Python interpreter.
The interpreter argument specifies the name of the Python interpreter.
That is the interpreter with which the archive will be executed.
The --main option writes a __main__.py file to the archive that executes mainfn.
The same options in the source docs
The module also provides tools to manage the creation of zip files containing Python code.
The interpreter can execute those archives directly.
The --main option writes a __main__.py file to the archive that executes mainfn.
See also
Claims
- id: C1 claim: zipapp manages zip files of Python code that the interpreter can run directly. source: S1 evidence: "executed directly by the Python interpreter"
- id: C2 claim: --main writes a __main__.py file that executes a given function. source: S1 evidence: "Write a __main__.py file to the archive that executes"
- id: C3 claim: The module manages creation of zip files containing Python code. source: S2 evidence: "creation of zip files containing Python code"
Sources
- [S1] zipapp — Manage executable Python zip archives. Python Software Foundation. https://docs.python.org/3/library/zipapp.html . License: PSF License Version 2. Accessed 2026-11-23.
- [S2] zipapp documentation (source). CPython. https://raw.githubusercontent.com/python/cpython/main/Doc/library/zipapp.rst . License: PSF License Version 2. Accessed 2026-11-23.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, zipapp — Manage executable Python zip archives; CPython, zipapp documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, zipapp — Manage executable Python zip archives; CPython, zipapp documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation.
Cite this
iinventedlight. 2026. "zipapp: build executable zip archives of Python code." iinventedlight Library, iil:note:kjhzgrr2, version of 2026-11-23. https://iinventedlight.com/library/notes/python-zipapp/. License: CC-BY-4.0.
@misc{iil_note_kjhzgrr2,
author = {{iinventedlight}},
title = {{zipapp: build executable zip archives of Python code}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-23},
url = {https://iinventedlight.com/library/notes/python-zipapp/},
note = {Permanent ID iil:note:kjhzgrr2. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- python-zipapp.schema.json (schema; CC-BY-4.0)
- python-zipapp.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/python-zipapp.md.