Metadata-Version: 2.4
Name: encoder8019ab
Version: 1.0.0
Summary: Compress and encode files/folders into self-extracting Python scripts
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: tqdm>=4.60
Requires-Dist: py7zr>=0.20

# encoder-hh8019

Compress folders and encode files/archives into **self-extracting Python scripts**.  
Each encoded `.py` file contains the full archive as base64 — just run it on any machine with Python to extract.

---

## Install

```bash
pip install encoder8019ab
```

Dependencies (`tqdm`, `py7zr`) are installed automatically.

---

## Usage — Python

```python
from encoder import encode, update_encoded_files

# Compress a folder → photos.py  (max 7z compression)
encode(r"C:/backups/photos")

# Encode an existing archive → data.py
encode(r"C:/backups/data.zip")

# Encode to a specific output folder, keep the original
encode(r"C:/backups/data.rar", output_folder=r"C:/out", delete_after=False)

# Batch encode all .zip files in a folder
encode(r"C:/backups/*.zip", output_folder=r"C:/out")

# Update decoder in all previously encoded .py files (keeps data intact)
update_encoded_files(r"C:/encoded_files")
```

---

## Usage — CLI

```bash
# Encode a file or folder
encoder8019ab encode C:/backups/photos
encoder8019ab encode C:/backups/data.zip C:/out
encoder8019ab encode "C:/backups/*.rar" --keep   # keep originals

# Update decoder in encoded .py files
encoder8019ab update C:/encoded_files
encoder8019ab update C:/encoded_files --no-recurse
```

Or via `python -m encoder`:

```bash
python -m encoder encode C:/backups/photos
python -m encoder update C:/encoded_files
```

---

## Running an encoded file

When you run a generated `.py` file, it will prompt you for the output format:

```
Output format (default=.bin):
  1=.zip  2=.rar  3=.7z  4=.tar  5=.tar.gz  6=.tar.bz2  7=.gz  8=.bz2
Enter number or extension (blank=.bin):
```

Press **Enter** for `.bin`, pick a number, or type any extension (e.g. `.zip`).  
The file is always extracted **next to the script**, with the script's base name.

---

## Updater

If you want to change how encoded files decode (e.g. new format options), just update the package and run:

```python
from encoder import update_encoded_files
update_encoded_files(r"C:/my_encoded_files")
```

This patches the decoder logic in every `.py` while leaving the embedded data untouched.  
Files already on the current decoder version are skipped automatically.
