pydoc > zipapp

📛 NAME

zipapp

🚀 Quick Reference

Use CaseCommandDescription
📁 Pack directory into .pyzzipapp.create_archive('myapp')Creates myapp.pyz from directory myapp
🎯 Specify output targetzipapp.create_archive('myapp', 'dist/myapp.pyz')Writes archive to dist/myapp.pyz
🐍 Set custom interpreterzipapp.create_archive('myapp', interpreter='/usr/bin/python3')Adds shebang line for a specific Python
🚀 Define entry pointzipapp.create_archive('myapp', main='myapp.module:main')Uses given callable as __main__.py entry
🗜️ Compress archivezipapp.create_archive('myapp', compressed=True)Creates a compressed zipapp (deflate)
🔍 Get interpreter from archivezipapp.get_interpreter('myapp.pyz')Returns the interpreter declared in the archive

📚 MODULE REFERENCE

https://docs.python.org/3.10/library/zipapp.html

The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above.

🏛️ CLASSES

builtins.ValueError(builtins.Exception) → ZipAppError

🐛 class ZipAppError(builtins.ValueError)

Method resolution order:

Data descriptors defined here:

Methods inherited from builtins.ValueError:

Static methods inherited from builtins.ValueError:

Methods inherited from builtins.BaseException:

Data descriptors inherited from builtins.BaseException:

⚙️ FUNCTIONS

📦 create_archive

create_archive(source, target=None, interpreter=None, main=None, filter=None, compressed=False)

Create an application archive from SOURCE.

The SOURCE can be the name of a directory, or a filename or a file-like object referring to an existing archive.

The content of SOURCE is packed into an application archive in TARGET, which can be a filename or a file-like object. If SOURCE is a directory, TARGET can be omitted and will default to the name of SOURCE with .pyz appended.

The created application archive will have a shebang line specifying that it should run with INTERPRETER (there will be no shebang line if INTERPRETER is None), and a __main__.py which runs MAIN (if MAIN is not specified, an existing __main__.py will be used). It is an error to specify MAIN for anything other than a directory source with no __main__.py, and it is an error to omit MAIN if the directory has no __main__.py.

🔍 get_interpreter

get_interpreter(archive)

📊 DATA

__all__ = ['ZipAppError', 'create_archive', 'get_interpreter']

📁 FILE

/usr/lib/python3.10/zipapp.py

zipapp
📛 NAME 🚀 Quick Reference 📚 MODULE REFERENCE 🏛️ CLASSES
🐛 class ZipAppError(builtins.ValueError)
⚙️ FUNCTIONS
📦 create_archive 🔍 get_interpreter
📊 DATA 📁 FILE

Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 13:17 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^