pdf-zipper


Namepdf-zipper JSON
Version 1.2.2 PyPI version JSON
download
home_pageNone
SummaryA powerful file processing tool supporting PDF compression and PDF/PPTX conversion with GUI and CLI interfaces
upload_time2025-07-11 16:50:22
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords cli compression conversion gui pdf powerpoint pptx textual
VCS
bugtrack_url
requirements PyMuPDF Pillow python-pptx rich questionary textual
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ๐Ÿ—œ๏ธ PDF Zipper

<div align="center">

[![PyPI version](https://badge.fury.io/py/pdf-zipper.svg)](https://badge.fury.io/py/pdf-zipper)
![Python](https://img.shields.io/badge/python-3.8+-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20-lightgrey.svg)
![Status](https://img.shields.io/badge/status-stable-brightgreen.svg)

</div>

A powerful file processing tool supporting PDF compression, format conversion (PDF โ†” PPTX), with both GUI and CLI interfaces, built with modern Python.

## ๐Ÿ“ธ Screenshots

<div align="center">
<table>
<tr>
<td width="50%">

### ๐Ÿ–ฅ๏ธ Beautiful Terminal GUI
![GUI Interface](./examples/screenshot-gui.png)
*Interactive file browser with drag & drop support*

</td>
<td width="50%">

### โŒจ๏ธ Powerful Command Line Interface
![CLI Interface](./examples/screenshot-cli.png)
*Rich output with progress indicators and detailed info*

</td>
</tr>
</table>
</div>

## โœจ Features

- **๐ŸŽฏ Auto Compression**: Automatically compress PDFs and PPTX files to a target file size
- **๐Ÿ”ง Manual Compression**: Compress PDFs with custom DPI settings
- **๐Ÿ“Š Bi-directional Conversion**: Convert between PDF and PowerPoint formats (PDF โ†” PPTX)
- **๐Ÿ“ Multi-format Support**: Process both PDF (.pdf) and PowerPoint (.pptx) files
- **๐Ÿ–ฅ๏ธ Beautiful GUI**: Modern terminal-based interface using Textual
- **โŒจ๏ธ CLI Interface**: Full command-line support with rich output
- **๐Ÿ“ Drag & Drop Support**: Easy file selection in GUI mode
- **๐Ÿ”„ Format Detection**: Automatic file type detection and validation
- **๐Ÿ“ฆ Easy Installation**: Install as a system command

## ๐Ÿš€ Installation

### From PyPI (Recommended)
```bash
pip install pdf-zipper
```

### From Source
```bash
git clone https://github.com/your-username/pdf-zipper.git
cd pdf-zipper
pip install -e .
```

### Standalone Executable (No Python Required)

<pre align="center">
๐Ÿงช Working in Progress
</pre>

Download the pre-built executable for your platform:

**macOS (Apple Silicon)**
```bash
# Option 1: App Bundle (Recommended for GUI users)
# Download PDF-Zipper-darwin-arm64.app from releases page
# Double-click to launch GUI interface

# Option 2: Command Line Executable
# Download from releases page
chmod +x pdf-zipper-gui-darwin-arm64
./pdf-zipper-gui-darwin-arm64 --help
./pdf-zipper-gui-darwin-arm64 gui  # Launch GUI
```

**Windows**
```cmd
REM Download from releases page
pdf-zipper-cli-windows-x64.exe --help
```

**Linux**
```bash
# Download from releases page
chmod +x pdf-zipper-cli-linux-x64
./pdf-zipper-cli-linux-x64 --help
```

### From Source
```bash
git clone https://github.com/your-username/pdf-zipper.git
cd pdf-zipper
pip install -e .
```

### Using Installation Script
```bash
git clone https://github.com/your-username/pdf-zipper.git
cd pdf-zipper
./install.sh
```

## ๐Ÿ“– Usage

### CLI Commands

After installation, you can use `pdf-zipper` or `pdfzip` commands:

```bash
# Launch GUI
pdf-zipper gui

# Compress PDF to specific size (auto mode)
pdf-zipper compress input.pdf --target-size 5.0

# Compress PDF with specific DPI (manual mode)
pdf-zipper compress input.pdf --dpi 150

# Convert PPTX to PDF (new feature!)
pdf-zipper compress presentation.pptx

# Convert PDF to PowerPoint
pdf-zipper convert input.pdf

# Convert PowerPoint to PDF (new feature!)
pdf-zipper convert presentation.pptx

# Show file information (supports PDF and PPTX)
pdf-zipper info input.pdf
pdf-zipper info presentation.pptx

# Show help
pdf-zipper --help
```

The CLI provides rich, colorful output with progress indicators and detailed information (see CLI screenshot above).

### GUI Mode
```bash
pdf-zipper gui
```

The GUI provides an intuitive interface with file browser, drag & drop support, and real-time progress logging (see screenshot above).

### Programmatic Usage
```python
from pdf_zipper import autocompress, autocompress_pdf, autocompress_pptx, autocompress_pdf_to_pptx, compress_pdf, convert_to_ppt

# Universal auto compression (supports format conversion)
autocompress("input.pdf", "output.pdf", 5.0, print)      # PDF โ†’ PDF
autocompress("input.pptx", "output.pptx", 5.0, print)    # PPTX โ†’ PPTX
autocompress("input.pdf", "output.pptx", 5.0, print)     # PDF โ†’ PPTX (NEW!)

# Specific auto compression functions
autocompress_pdf("input.pdf", "output.pdf", 5.0, print)           # PDF โ†’ PDF
autocompress_pptx("input.pptx", "output.pptx", 5.0, print)        # PPTX โ†’ PPTX
autocompress_pdf_to_pptx("input.pdf", "output.pptx", 5.0, print)  # PDF โ†’ PPTX (NEW!)

# Manual compression and conversion
compress_pdf("input.pdf", "output.pdf", 150, print)      # Manual PDF compression
convert_to_ppt("input.pdf", "output.pptx", 150, print)   # PDF โ†’ PPTX conversion
```

## ๐Ÿ› ๏ธ Development

### Setup Development Environment
```bash
git clone https://github.com/your-username/pdf-zipper.git
cd pdf-zipper
pip install -e ".[dev]"
```

### Run Tests
```bash
pytest
```

### Code Formatting
```bash
black src/
isort src/
```

## ๐Ÿ“‹ Requirements

- Python 3.8+
- PyMuPDF (fitz)
- Pillow
- python-pptx
- rich
- textual
- typer

## ๐Ÿ”ง How It Works

1. **Auto Compression**:
   - **PDF โ†’ PDF**: Uses binary search to find the optimal DPI that achieves the target file size
   - **PPTX โ†’ PPTX**: Converts PPTX โ†’ PDF โ†’ optimizes DPI โ†’ converts back to PPTX
   - **PDF โ†’ PPTX**: Optimizes PDF DPI โ†’ converts to PowerPoint format (NEW!)
2. **Manual Compression**: Converts PDF pages to images at specified DPI and recreates the PDF
3. **Format Conversion**:
   - **PDF to PPT**: Extracts each page as an image and creates PowerPoint slides
   - **PPTX to PDF**: Uses system tools (LibreOffice, unoconv) or Windows COM interface

## ๐Ÿ’ก Tips

- Higher DPI = better quality but larger file size
- Auto compression may take longer but provides precise size control
- For best results, start with the auto compression feature
- **Format Conversion Options**:
  - **PDF โ†’ PDF**: Direct optimization for fastest processing
  - **PPTX โ†’ PPTX**: Maintains PowerPoint format while achieving target size
  - **PDF โ†’ PPTX**: Convert and optimize in one step (NEW!)
- Use the GUI for interactive file selection and real-time progress
- Use CLI for batch processing and automation

## ๐Ÿ“„ License

MIT License - see [LICENSE](LICENSE) file for details.

## ๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pdf-zipper",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "cli, compression, conversion, gui, pdf, powerpoint, pptx, textual",
    "author": null,
    "author_email": "PDF Zipper Team <team@pdfzipper.com>",
    "download_url": "https://files.pythonhosted.org/packages/fd/51/c74479f3fd9a768d3218d861b19ae2301738341b08e726102b721faee239/pdf_zipper-1.2.2.tar.gz",
    "platform": null,
    "description": "# \ud83d\udddc\ufe0f PDF Zipper\n\n<div align=\"center\">\n\n[![PyPI version](https://badge.fury.io/py/pdf-zipper.svg)](https://badge.fury.io/py/pdf-zipper)\n![Python](https://img.shields.io/badge/python-3.8+-blue.svg)\n![License](https://img.shields.io/badge/license-MIT-green.svg)\n![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20-lightgrey.svg)\n![Status](https://img.shields.io/badge/status-stable-brightgreen.svg)\n\n</div>\n\nA powerful file processing tool supporting PDF compression, format conversion (PDF \u2194 PPTX), with both GUI and CLI interfaces, built with modern Python.\n\n## \ud83d\udcf8 Screenshots\n\n<div align=\"center\">\n<table>\n<tr>\n<td width=\"50%\">\n\n### \ud83d\udda5\ufe0f Beautiful Terminal GUI\n![GUI Interface](./examples/screenshot-gui.png)\n*Interactive file browser with drag & drop support*\n\n</td>\n<td width=\"50%\">\n\n### \u2328\ufe0f Powerful Command Line Interface\n![CLI Interface](./examples/screenshot-cli.png)\n*Rich output with progress indicators and detailed info*\n\n</td>\n</tr>\n</table>\n</div>\n\n## \u2728 Features\n\n- **\ud83c\udfaf Auto Compression**: Automatically compress PDFs and PPTX files to a target file size\n- **\ud83d\udd27 Manual Compression**: Compress PDFs with custom DPI settings\n- **\ud83d\udcca Bi-directional Conversion**: Convert between PDF and PowerPoint formats (PDF \u2194 PPTX)\n- **\ud83d\udcc1 Multi-format Support**: Process both PDF (.pdf) and PowerPoint (.pptx) files\n- **\ud83d\udda5\ufe0f Beautiful GUI**: Modern terminal-based interface using Textual\n- **\u2328\ufe0f CLI Interface**: Full command-line support with rich output\n- **\ud83d\udcc1 Drag & Drop Support**: Easy file selection in GUI mode\n- **\ud83d\udd04 Format Detection**: Automatic file type detection and validation\n- **\ud83d\udce6 Easy Installation**: Install as a system command\n\n## \ud83d\ude80 Installation\n\n### From PyPI (Recommended)\n```bash\npip install pdf-zipper\n```\n\n### From Source\n```bash\ngit clone https://github.com/your-username/pdf-zipper.git\ncd pdf-zipper\npip install -e .\n```\n\n### Standalone Executable (No Python Required)\n\n<pre align=\"center\">\n\ud83e\uddea Working in Progress\n</pre>\n\nDownload the pre-built executable for your platform:\n\n**macOS (Apple Silicon)**\n```bash\n# Option 1: App Bundle (Recommended for GUI users)\n# Download PDF-Zipper-darwin-arm64.app from releases page\n# Double-click to launch GUI interface\n\n# Option 2: Command Line Executable\n# Download from releases page\nchmod +x pdf-zipper-gui-darwin-arm64\n./pdf-zipper-gui-darwin-arm64 --help\n./pdf-zipper-gui-darwin-arm64 gui  # Launch GUI\n```\n\n**Windows**\n```cmd\nREM Download from releases page\npdf-zipper-cli-windows-x64.exe --help\n```\n\n**Linux**\n```bash\n# Download from releases page\nchmod +x pdf-zipper-cli-linux-x64\n./pdf-zipper-cli-linux-x64 --help\n```\n\n### From Source\n```bash\ngit clone https://github.com/your-username/pdf-zipper.git\ncd pdf-zipper\npip install -e .\n```\n\n### Using Installation Script\n```bash\ngit clone https://github.com/your-username/pdf-zipper.git\ncd pdf-zipper\n./install.sh\n```\n\n## \ud83d\udcd6 Usage\n\n### CLI Commands\n\nAfter installation, you can use `pdf-zipper` or `pdfzip` commands:\n\n```bash\n# Launch GUI\npdf-zipper gui\n\n# Compress PDF to specific size (auto mode)\npdf-zipper compress input.pdf --target-size 5.0\n\n# Compress PDF with specific DPI (manual mode)\npdf-zipper compress input.pdf --dpi 150\n\n# Convert PPTX to PDF (new feature!)\npdf-zipper compress presentation.pptx\n\n# Convert PDF to PowerPoint\npdf-zipper convert input.pdf\n\n# Convert PowerPoint to PDF (new feature!)\npdf-zipper convert presentation.pptx\n\n# Show file information (supports PDF and PPTX)\npdf-zipper info input.pdf\npdf-zipper info presentation.pptx\n\n# Show help\npdf-zipper --help\n```\n\nThe CLI provides rich, colorful output with progress indicators and detailed information (see CLI screenshot above).\n\n### GUI Mode\n```bash\npdf-zipper gui\n```\n\nThe GUI provides an intuitive interface with file browser, drag & drop support, and real-time progress logging (see screenshot above).\n\n### Programmatic Usage\n```python\nfrom pdf_zipper import autocompress, autocompress_pdf, autocompress_pptx, autocompress_pdf_to_pptx, compress_pdf, convert_to_ppt\n\n# Universal auto compression (supports format conversion)\nautocompress(\"input.pdf\", \"output.pdf\", 5.0, print)      # PDF \u2192 PDF\nautocompress(\"input.pptx\", \"output.pptx\", 5.0, print)    # PPTX \u2192 PPTX\nautocompress(\"input.pdf\", \"output.pptx\", 5.0, print)     # PDF \u2192 PPTX (NEW!)\n\n# Specific auto compression functions\nautocompress_pdf(\"input.pdf\", \"output.pdf\", 5.0, print)           # PDF \u2192 PDF\nautocompress_pptx(\"input.pptx\", \"output.pptx\", 5.0, print)        # PPTX \u2192 PPTX\nautocompress_pdf_to_pptx(\"input.pdf\", \"output.pptx\", 5.0, print)  # PDF \u2192 PPTX (NEW!)\n\n# Manual compression and conversion\ncompress_pdf(\"input.pdf\", \"output.pdf\", 150, print)      # Manual PDF compression\nconvert_to_ppt(\"input.pdf\", \"output.pptx\", 150, print)   # PDF \u2192 PPTX conversion\n```\n\n## \ud83d\udee0\ufe0f Development\n\n### Setup Development Environment\n```bash\ngit clone https://github.com/your-username/pdf-zipper.git\ncd pdf-zipper\npip install -e \".[dev]\"\n```\n\n### Run Tests\n```bash\npytest\n```\n\n### Code Formatting\n```bash\nblack src/\nisort src/\n```\n\n## \ud83d\udccb Requirements\n\n- Python 3.8+\n- PyMuPDF (fitz)\n- Pillow\n- python-pptx\n- rich\n- textual\n- typer\n\n## \ud83d\udd27 How It Works\n\n1. **Auto Compression**:\n   - **PDF \u2192 PDF**: Uses binary search to find the optimal DPI that achieves the target file size\n   - **PPTX \u2192 PPTX**: Converts PPTX \u2192 PDF \u2192 optimizes DPI \u2192 converts back to PPTX\n   - **PDF \u2192 PPTX**: Optimizes PDF DPI \u2192 converts to PowerPoint format (NEW!)\n2. **Manual Compression**: Converts PDF pages to images at specified DPI and recreates the PDF\n3. **Format Conversion**:\n   - **PDF to PPT**: Extracts each page as an image and creates PowerPoint slides\n   - **PPTX to PDF**: Uses system tools (LibreOffice, unoconv) or Windows COM interface\n\n## \ud83d\udca1 Tips\n\n- Higher DPI = better quality but larger file size\n- Auto compression may take longer but provides precise size control\n- For best results, start with the auto compression feature\n- **Format Conversion Options**:\n  - **PDF \u2192 PDF**: Direct optimization for fastest processing\n  - **PPTX \u2192 PPTX**: Maintains PowerPoint format while achieving target size\n  - **PDF \u2192 PPTX**: Convert and optimize in one step (NEW!)\n- Use the GUI for interactive file selection and real-time progress\n- Use CLI for batch processing and automation\n\n## \ud83d\udcc4 License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A powerful file processing tool supporting PDF compression and PDF/PPTX conversion with GUI and CLI interfaces",
    "version": "1.2.2",
    "project_urls": {
        "Homepage": "https://github.com/wibus-wee/pdf-zipper",
        "Issues": "https://github.com/wibus-wee/pdf-zipper/issues",
        "Repository": "https://github.com/wibus-wee/pdf-zipper"
    },
    "split_keywords": [
        "cli",
        " compression",
        " conversion",
        " gui",
        " pdf",
        " powerpoint",
        " pptx",
        " textual"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "453c84323195d9694961d282011d3ccbf26b03cf8888485ffe6003aec4537b87",
                "md5": "a77ec173b7ea53a02043230d8a73783c",
                "sha256": "23bfc50f28b617c4c3180fc0d4947a21c139f5d0a5872a096453cf912c2cb06c"
            },
            "downloads": -1,
            "filename": "pdf_zipper-1.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a77ec173b7ea53a02043230d8a73783c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 20907,
            "upload_time": "2025-07-11T16:50:21",
            "upload_time_iso_8601": "2025-07-11T16:50:21.674210Z",
            "url": "https://files.pythonhosted.org/packages/45/3c/84323195d9694961d282011d3ccbf26b03cf8888485ffe6003aec4537b87/pdf_zipper-1.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fd51c74479f3fd9a768d3218d861b19ae2301738341b08e726102b721faee239",
                "md5": "2eec485a6b7c01bcd5e5f5471c6834e8",
                "sha256": "55693bebc386b421959d11ddf58ebbbeae1ba921699f13ab3d5f82d85275071f"
            },
            "downloads": -1,
            "filename": "pdf_zipper-1.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "2eec485a6b7c01bcd5e5f5471c6834e8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 20014,
            "upload_time": "2025-07-11T16:50:22",
            "upload_time_iso_8601": "2025-07-11T16:50:22.928368Z",
            "url": "https://files.pythonhosted.org/packages/fd/51/c74479f3fd9a768d3218d861b19ae2301738341b08e726102b721faee239/pdf_zipper-1.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-11 16:50:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wibus-wee",
    "github_project": "pdf-zipper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "PyMuPDF",
            "specs": []
        },
        {
            "name": "Pillow",
            "specs": []
        },
        {
            "name": "python-pptx",
            "specs": []
        },
        {
            "name": "rich",
            "specs": []
        },
        {
            "name": "questionary",
            "specs": []
        },
        {
            "name": "textual",
            "specs": []
        }
    ],
    "lcname": "pdf-zipper"
}
        
Elapsed time: 1.06632s