Metadata-Version: 2.4
Name: toolvix
Version: 0.1.0
Summary: Simple dynamic file, PDF, and image automation tools for Python
Author-email: "A.Preetam krishna" <preetam.200729@gmail.com>
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: Pillow>=10.0
Requires-Dist: pypdf>=4.0
Requires-Dist: pdf2docx>=0.5.6
Requires-Dist: PyMuPDF>=1.24
Requires-Dist: python-pptx>=0.6.23
Requires-Dist: cryptography>=42.0
Provides-Extra: windows
Requires-Dist: pywin32>=306; extra == "windows"

# Toolvix

Toolvix is a Python library for simple file, PDF, PowerPoint, Word, and image automation.
Most functions automatically discover matching files in the **current working folder**, so users do not need to pass input filenames.

## Installation

```bash
pip install toolvix
```

For PowerPoint/Word to PDF conversion on Windows, Microsoft PowerPoint and Microsoft Word must be installed, and install the Windows extra:

```bash
pip install "toolvix[windows]"
```

## Quick start

```python
from toolvix import *

pdfMerge("final.pdf")
pdfExtract([1, 2], "extract.pdf")
pdfProtect("protected.pdf", "12345")

imageTopdf("photos.pdf")
imageResize(1920, 1080)
imageWatermark("PREETAM")
imageCompressor(1)

fileEncrypt()
fileDecrypt()
```

## API

| # | Library | Package | Module | Function | Parameters | Dynamic Input | Output | Example |
|---|---|---|---|---|---|---|---|---|
| 1 | `toolvix` | `filetools` | `encrypt.py` | `fileEncrypt()` | None | All non-`.encrypted` files | Encrypted `.encrypted` files | `fileEncrypt()` |
| 2 | `toolvix` | `filetools` | `decrypt.py` | `fileDecrypt()` | None | All `.encrypted` files | Decrypted original files | `fileDecrypt()` |
| 3 | `toolvix` | `pdftools` | `merge.py` | `pdfMerge()` | `output_file` | All PDFs | One merged PDF | `pdfMerge("final.pdf")` |
| 4 | `toolvix` | `pdftools` | `extract.py` | `pdfExtract()` | `pages, output_file` | First PDF | Extracted PDF | `pdfExtract([1, 2], "extract.pdf")` |
| 5 | `toolvix` | `pdftools` | `protect.py` | `pdfProtect()` | `output_file, password` | First PDF | Protected PDF | `pdfProtect("protected.pdf", "12345")` |
| 6 | `toolvix` | `pdftools` | `pdftoword.py` | `pdfToword()` | `output_file` (optional) | All PDFs | Word file(s) | `pdfToword()` |
| 7 | `toolvix` | `pdftools` | `pdftoppt.py` | `pdfToppt()` | `output_file` (optional) | All PDFs | PowerPoint file(s) | `pdfToppt()` |
| 8 | `toolvix` | `pdftools` | `ppttopdf.py` | `pptTopdf()` | `output_file` (optional) | All PPTX files | PDF file(s) | `pptTopdf()` |
| 9 | `toolvix` | `pdftools` | `wordtopdf.py` | `wordTopdf()` | `output_file` (optional) | All DOCX files | PDF file(s) | `wordTopdf()` |
| 10 | `toolvix` | `imagetools` | `imgtopdf.py` | `imageTopdf()` | `output_file` | All supported images | One PDF | `imageTopdf("photos.pdf")` |
| 11 | `toolvix` | `imagetools` | `imgresize.py` | `imageResize()` | `width, height` | All supported images | Resized image(s) | `imageResize(1920, 1080)` |
| 12 | `toolvix` | `imagetools` | `imgwatermark.py` | `imageWatermark()` | `watermarkText, textSize, transparency, angle` | All supported images | Watermarked image(s) | `imageWatermark("PREETAM")` |
| 13 | `toolvix` | `imagetools` | `imgcompress.py` | `imageCompressor()` | `targetSizeMB` | All supported images | Compressed JPG(s) | `imageCompressor(1)` |
| 14 | `toolvix` | `imagetools` | `pdftoimg.py` | `pdfToimage()` | None | All PDFs | Page image(s) | `pdfToimage()` |

## Parameters

### PDF tools
- `pdfMerge(output_file="Merged.pdf")`: merges every PDF in the current folder in sorted filename order.
- `pdfExtract(pages, output_file="extracted.pdf")`: extracts selected 1-based page numbers from the first PDF.
- `pdfProtect(output_file="protected.pdf", password="12345")`: password-protects the first PDF.
- `pdfToword(output_file=None)`: converts every PDF to DOCX. With one input PDF, `output_file` can set its output name.
- `pdfToppt(output_file=None)`: converts every PDF to PPTX. With one input PDF, `output_file` can set its output name.
- `pptTopdf(output_file=None)`: converts every PPTX to PDF. With one input PPTX, `output_file` can set its output name. Windows + Microsoft PowerPoint required.
- `wordTopdf(output_file=None)`: converts every DOCX to PDF. With one input DOCX, `output_file` can set its output name. Windows + Microsoft Word required.

### Image tools
- `imageTopdf(output_file="photos.pdf")`: combines all supported images into one PDF.
- `imageResize(width=1920, height=1080)`: resizes all supported images without cropping; aspect ratio is preserved.
- `imageWatermark(watermarkText="PREETAM", textSize=100, transparency=45, angle=25)`: adds centered watermark text. `transparency=0` is invisible and `255` is fully opaque.
- `imageCompressor(targetSizeMB=1)`: compresses all supported images to JPG, targeting approximately the requested size in MB.
- `pdfToimage()`: converts every PDF page to a PNG image.

### File tools
- `fileEncrypt()`: asks once for a password and encrypts every non-`.encrypted` file in the current folder.
- `fileDecrypt()`: asks once for a password and decrypts every `.encrypted` file. Successfully decrypted files replace their `.encrypted` versions with the original filenames.

## Output folders

Toolvix keeps generated files in separate folders such as `merged pdf`, `converted word files`, `resized images`, and `compressed images`.

## Notes

- Input files are discovered from `Path.cwd()`. Run your script from the folder containing the files you want Toolvix to process.
- Do not store passwords or sensitive files in the working folder when using `fileEncrypt()`.
