# paker

> A developer tool for shipping smaller PyInstaller and PyArmor builds to clients by loading packages from memory at runtime.

Wojciech Wentland · https://blog.wentland.io/projects/paker/

Status: stable · License: MIT · Source: https://github.com/desty2k/paker

paker packs a Python package tree, including native extensions, into an encrypted bundle and imports it from memory.
A PyInstaller or PyArmor build no longer has to carry every dependency inside the binary: the dependencies arrive at
runtime, and the binary you ship to a client gets smaller.

```python
bundle = paker.dumps("myapp", key=key, include_deps=True)   # on your machine

with paker.loads(bundle, key=key):                           # on the client
    import myapp
    myapp.run()
```

## What it handles

- `.py`, `.pyc` and native extensions (`.so`, `.pyd`, `.dll`), loaded without writing them to disk where the
  operating system allows it. Each platform needs a different trick; [this post covers all three](https://blog.wentland.io/blog/loading-code-without-the-disk/).
- Packages with bundled native libraries, such as Pillow and NumPy.
- Resource files through `importlib.resources`.
- A key that travels separately from the bundle, for example from your own license server.

## What I would not rely on

The encryption started as an attempt at code obfuscation. I wouldn't lean on it today: coding agents are good at
reverse engineering, and a determined reader with one will get through. The smaller builds and the runtime loading
don't depend on it.

paker is meant for professional use, for packaging your own software and shipping it to your own clients.
