Metadata-Version: 2.4
Name: pyverix
Version: 0.1.0
Summary: PDF to Excel converter, Excel report generator, and data utilities
Author-email: Muhammad Subhan <subhan.kh753@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/muhammadsubhan/pyverix
Project-URL: Documentation, https://github.com/muhammadsubhan/pyverix#readme
Project-URL: Issues, https://github.com/muhammadsubhan/pyverix/issues
Keywords: pdf,excel,xlsx,report,converter,data
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pdfplumber>=0.10
Requires-Dist: openpyxl>=3.1
Requires-Dist: pandas>=2.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file

# PyVerix 🔧

> A Python library for PDF extraction, Excel report generation, and data utilities.

## Installation

```bash
pip install pyverix
```

Or from source:

```bash
git clone https://github.com/muhammadsubhan/pyverix
cd pyverix
pip install -e ".[dev]"
```

---

## Features

| Module | Class | What it does |
|---|---|---|
| `converters` | `PDFToExcel` | Extract tables & text from PDFs → styled .xlsx |
| `generators` | `ExcelReportGenerator` | Build multi-sheet Excel reports from data |
| `generators` | `SummaryReportGenerator` | Build KPI dashboard sheets |
| `utils` | `format_currency` | Format numbers as currency strings |
| `utils` | `format_percentage` | Format decimals as percentage strings |
| `utils` | `auto_fit_columns` | Auto-fit column widths in openpyxl sheets |

---

## Quick Start

### PDF → Excel

```python
from pyverix import PDFToExcel

converter = PDFToExcel("invoice.pdf")
converter.convert("invoice_tables.xlsx")

# Include raw text as an extra sheet
converter.convert("invoice_full.xlsx", include_text=True)

# Custom header color
converter.convert("invoice_styled.xlsx", header_color="375623")
```

### Excel Report Generator

```python
from pyverix import ExcelReportGenerator

gen = ExcelReportGenerator(title="Monthly Sales Report", theme="blue")

gen.add_cover(author="Muhammad Subhan", company="PyVerix Inc.")

gen.add_sheet("Sales", [
    {"Product": "Widget A", "Units": 120, "Revenue": 2400},
    {"Product": "Widget B", "Units": 85,  "Revenue": 1700},
], add_totals=True, add_chart=True, chart_col="Revenue")

gen.add_sheet("Attendance", df_attendance)

gen.save("monthly_report.xlsx")
```

**Themes:** `blue` (default), `green`, `red`, `purple`

### KPI Dashboard

```python
from pyverix import SummaryReportGenerator

gen = SummaryReportGenerator("Q2 KPI Dashboard")

gen.add_kpi("Total Revenue", 125000, prefix="$", change=+8.3)
gen.add_kpi("Orders",        4321,               change=-2.1)
gen.add_kpi("CSAT",          92,     suffix="%",  highlight="green")

gen.add_section_break("Staff Attendance")
gen.add_kpi("Present Today", 47)
gen.add_kpi("On Leave",       3, highlight="red")

gen.save("dashboard.xlsx")
```

### Utility Functions

```python
from pyverix import format_currency, format_percentage, auto_fit_columns

format_currency(1234.5)         # "$1,234.50"
format_currency(9999, "£", 0)   # "£9,999"
format_percentage(0.853)        # "85.3%"

# Auto-fit all columns in an openpyxl sheet
from openpyxl import load_workbook
wb = load_workbook("report.xlsx")
auto_fit_columns(wb.active)
wb.save("report.xlsx")
```

---

## Project Structure

```
pyverix/
├── pyverix/
│   ├── __init__.py               ← public API
│   ├── converters/
│   │   └── pdf_to_excel.py       ← PDFToExcel
│   ├── generators/
│   │   ├── excel_report.py       ← ExcelReportGenerator
│   │   └── summary_report.py     ← SummaryReportGenerator
│   └── utils/
│       └── formatter.py          ← format_currency, format_percentage, auto_fit_columns
├── tests/
│   └── test_pyverix.py
├── pyproject.toml
└── README.md
```

---

## Running Tests

```bash
pip install pytest
pytest tests/ -v
```

---

## Publishing to PyPI

```bash
pip install build twine
python -m build
twine upload dist/*
```

---

## Roadmap

- [ ] `CSVToExcel` converter
- [ ] `WordToExcel` converter
- [ ] `ExcelToJSON` exporter
- [ ] Conditional formatting rules helper
- [ ] Multi-page PDF with image extraction
- [ ] CLI tool (`pyverix convert report.pdf`)

---

## License

MIT License — free to use, modify, and distribute.
