Metadata-Version: 2.4
Name: pymzlib
Version: 1.0.3.post2
Summary: Pymzlib Modules
Home-page: 
Author: Everest
Author-email: 
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.14, <3.15
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-python
Dynamic: summary

# pymzlib

**pymzlib** is a toolkit for encrypting/obfuscating and decrypting/restoring Python source files (`.py`) or modules at the bytecode level. It aims to protect Python intellectual property by preventing source code from being easily decompiled or viewed.

## 📦 Installation。

```bash
pip install pymzlib
```
> **Note:** Ensure your Python environment version matches the target runtime environment to avoid bytecode compatibility issues.

### Compatibility

*   **Build Support:** Windows AMD64, Linux X86_64, Linux Aarch64
*   **Encrypted Execution Support:** Windows AMD64, Linux X86_64, Linux Aarch64, Android Armv8-a

## 🚀 Quick Start

pymzlib can be invoked directly via the command line or imported as a module within Python scripts.

### 1. Command-Line Interface (CLI)

**Basic Syntax:**
```bash
python -m pymzlib --op <operation> --path <file_path/directory> --key <secret_key> [other_options]
```
**Example 1: Encrypt a single Python file**
```bash
python -m pymzlib --op encode --path ./src/main.py --key "MySecretKey123"
```

**Example 2: Encrypt an entire module directory and disable variable obfuscation**
```bash
python -m pymzlib --op encode --path ./my_module --key "SecureKey" --is_module --without_obfuscate
```

### 2. Output Structure & Execution
After encryption, the processed files will be placed in the `./build/` directory. The original source code is automatically backed up in `./build/source/`. To run the protected application, simply execute the file using Python within an environment where `pymzlib` is installed.

## ⚙️ Parameters

| Parameter | Type | Description |
| :--- | :--- | :--- |
| `--op` | str | **Operation type.** Must be either `encode` or `decode`. |
| `--path` | str | **Target path.** Path to the target file or directory. |
| `--key` | str | **Secret key.** String used for encryption and decryption. |
| `--mode` | str | **Encryption format.** Default is `'pymz'`. |
| `--without_obfuscate` | flag | **Disable obfuscation.** If set, disables code obfuscation. By default, variable names are obfuscated to enhance security. |
| `--no_compile` | flag | **Skip compilation.** If set, skips compiling source code into bytecode; only performs encryption (allowing later `decode`). By default, compilation is enabled to improve load speed and increase reverse engineering difficulty. |
| `--is_module` | flag | **Module mode.** Indicates that `--path` points to a Python package/module directory rather than a single file. The tool will recursively process all `.py` files within the directory. |


