Metadata-Version: 2.4
Name: diy-packer
Version: 1.0.0
Summary: DIY Python to EXE packer. No PyInstaller. Uses csc.exe + ZIP polyglot.
Author: Your Name
License: MIT
Keywords: packer,exe,pyinstaller-alternative,python-to-exe
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# DIY Packer

A Python-to-EXE packer built from scratch. No PyInstaller, no cx_Freeze.

## Features

- Real `.exe` output using Windows built-in `csc.exe` (C# compiler)
- Fallback to pre-compiled embedded launcher when `csc.exe` is absent
- Auto-dependency analysis (scans `import` chain, collects `.pyd`/`.dll`/`.libs`)
- Smart file collection (traces import chain from entry script, not all files)
- Auto-detect asset directories (`asset`, `assets`, `res`, etc.)
- Interactive mode (double-click `Packer.exe` to use)
- Drag-and-drop support via `build.bat`
- Runtime optimizations: cached extraction, pre-compiled `.pyc`, cached DLL paths
- No console window by default (`pythonw.exe`)

## Install

### From PyPI
```
pip install diy-packer
```

### From source
```
git clone https://github.com/yourname/diy-packer.git
cd diy-packer
pip install .
```

## Usage

### Command line
```
# Pack a Python script into an .exe
diy-packer Main.py

# With options
diy-packer Main.py -o Engine --assets asset
diy-packer Main.py -o Engine --assets asset --console
```

### Interactive mode
Double-click `Packer.exe`:
```
packer> Main.py        # pack a file
packer> help           # show commands
packer> quit           # exit
```

### Drag and drop
Drag a `.py` file onto `build.bat`.

## How it works

```
Engine.exe = [C# launcher PE] + [ZIP data]
                         ↓ runtime
         C# launcher copies itself as .pyz
                         ↓
         Python runs .pyz → __main__.py extracts files
                         ↓
         Sets up sys.path, DLL paths, runs entry script
```

## Options

| Option | Description |
|--------|-------------|
| `<entry.py>` | Entry script (required) |
| `-o <name>` | Output name (default: same as entry) |
| `--assets <dir>` | Asset directories (space-separated) |
| `--console` | Show console window |
| `--no-auto-assets` | Disable auto asset detection |

## Limitations

- Windows only (uses `csc.exe` / .NET Framework)
- Target machine needs Python installed
- Output is a polyglot PE (launcher + ZIP)

## License

MIT
