Skip to main content

The depzip library can be used for zipping dependencies of Python applications.

This library uses the sys.modules dictionary to discover dependencies and the ctypes.util.dllist function to discover DLLs loaded by dependencies.

Installation

This library can be installed using pip:

python -m pip install depzip

Usage

Here is a Python script showing how to use depzip to copy the dependencies of a Python application using matplotlib, numpy, and PySide6 into a file called bundle.zip:

import depzip

depzip.bundle(
    applications=[
        "app",
        "pyside6-uic",
    ],
    modules=[
        "app",
        "PySide6.QtUiTools",
    ],
    includes=[
        "Lib\\site-packages\\matplotlib\\mpl-data",
        "Lib\\site-packages\\numpy.libs",
        "Lib\\site-packages\\pyside6-uic",
        "Lib\\site-packages\\PySide6\\plugins\\platforms\\qwindows.dll",
        "Lib\\site-packages\\PySide6\\plugins\\styles\\qmodernwindowsstyle.dll",
        "Lib\\site-packages\\PySide6\\uic.exe",
    ],
    excludes=[
        "python.exe",
        "pythonw.exe",
    ],
    output="bundle.zip",
)

The source code of this script can be found in examples/bundle.py.

The provided executable file run.exe can be used to run a Python application. It initializes Python and runs a module with the same name as the executable file. For example, to run a Python module named app, the executable file run.exe should be renamed to app.exe.

The source code of the executable file run.exe can be found in examples/run.c.

The applications parameter is a list of application names that is used to automatically copy run.exe to executable files with names in this list.

The modules parameter is a list of Python modules used by the applications. These modules are copied to the output file along with all their dependencies.

The includes parameter is a list of additional files and directories to be copied to the output file.

The excludes parameter is a list of files that should not be copied to the output file.

The output parameter is the name of the output file.

Metadata

Release files for depzip 0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for depzip 0.10
File Interpreter ABI Platform
depzip-0.10-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details

Release files / depzip-0.10-py3-none-win_amd64.whl

Download URL depzip-0.10-py3-none-win_amd64.whl
Size 17.8 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
aaeaf4092de1357619998676c51318058eb34b75becdc7a3a47f02ebcbdc22ea
BLAKE2b-256 checksum
How to use checksums
ee0ca787a2150c48a6cdbf736bf973c521ae409c2a5e61706e01b5fac9748233
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for depzip 0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page