Metadata-Version: 2.4
Name: depzip
Version: 0.2
Summary: A small library for zipping Python application dependencies
Author: Pavel Demin
License-Expression: MIT
Project-URL: Homepage, https://github.com/pavel-demin/depzip
Requires-Python: <3.14,>=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: dllist
Dynamic: license-file

This library can be used for zipping Python application dependencies.

This library uses the [dllist](https://github.com/wardbrian/dllist) library to discover required DLLs for 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=[
        "pyside6-uic",
    ],
    modules=[
        "matplotlib.backends.backend_qtagg",
        "matplotlib.figure",
        "matplotlib.style",
        "matplotlib",
        "numpy",
        "PySide6.QtCore",
        "PySide6.QtGui",
        "PySide6.QtNetwork",
        "PySide6.QtUiTools",
        "PySide6.QtWidgets",
    ],
    includes=[
        "Lib\\site-packages\\matplotlib\\mpl-data",
        "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](https://github.com/pavel-demin/depzip/tree/main/examples/bundle.py).

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

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

The source code of the executable file `import.exe` can be found in [examples/import.c](https://github.com/pavel-demin/depzip/tree/main/examples/import.c).
