Metadata-Version: 2.4
Name: preeti-unicode-converter
Version: 0.1.1
Summary: A highly customizable Python package for converting Preeti font text to Unicode (Nepali)
Project-URL: Homepage, https://github.com/diwaskunwar/preeti-unicode-converter
Project-URL: Repository, https://github.com/diwaskunwar/preeti-unicode-converter
Project-URL: Issues, https://github.com/diwaskunwar/preeti-unicode-converter/issues
Author-email: Diwas Kunwar <diwas.kuwar@gmail.com>
Maintainer-email: Diwas Kunwar <diwas.kuwar@gmail.com>
License: MIT
License-File: LICENSE
Keywords: conversion,devanagari,font,nepali,preeti,unicode
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: Nepali
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing
Classifier: Topic :: Text Processing :: Fonts
Classifier: Topic :: Utilities
Requires-Python: >=3.8.1
Requires-Dist: pymupdf>=1.23.0
Requires-Dist: python-docx>=1.1.0
Requires-Dist: reportlab>=4.0.0
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: flake8>=6.0.0; extra == 'dev'
Requires-Dist: isort>=5.12.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# Preeti Unicode Converter

A highly customizable Python package for converting Preeti font text to Unicode (Nepali). Supports multiple input and output formats including PDF, DOCX, and TXT files with enterprise-level features.

[![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://python.org)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![PyPI Version](https://img.shields.io/badge/pypi-v0.1.0-orange.svg)](https://pypi.org/project/preeti-unicode/)

## Features

### Core Functionality
- **Text Conversion**: Convert Preeti font text to proper Unicode Nepali text
- **Multiple Formats**: Support for PDF, DOCX, TXT, and HTML files
- **Batch Processing**: Convert multiple files simultaneously with parallel processing
- **CLI Interface**: Command-line tool for easy integration into workflows

### Advanced Features
- **Dynamic Font Support**: Add custom font mappings and user-defined conversion rules
- **Plugin Architecture**: Extensible system for custom conversion logic
- **Processing Pipelines**: Configurable conversion workflows with middleware support
- **Caching System**: Improved performance with intelligent caching
- **Progress Tracking**: Real-time progress monitoring for large operations
- **Error Handling**: Comprehensive error management with graceful degradation

### Enterprise Features
- **PDF Processing**: Robust PDF handling with integrity validation and corruption detection
- **Parallel Processing**: Multi-threaded processing for high-performance batch operations
- **Logging System**: Structured logging with multiple output formats
- **Configuration Management**: Flexible configuration system with environment variable support

## Installation

### Using pip (Recommended)
```bash
pip install preeti-unicode
```

### Using uv (Fast)
```bash
uv add preeti-unicode
```

### From Source
```bash
git clone https://github.com/diwaskunwar/preeti-unicode.git
cd preeti-unicode
pip install -e .
```

## Quick Start

### Basic Text Conversion
```python
from preeti_unicode import convert_text

# Convert Preeti text to Unicode
result = convert_text("g]kfn")
print(result)  # Output: नेपाल

# Convert with custom options
result = convert_text("g]kfn @)!&", convert_numbers=True)
print(result)  # Output: नेपाल २०१७
```

### File Conversion
```python
from preeti_unicode import file_converter

# Convert a PDF file to Unicode text
success = file_converter(
    input_file="document.pdf",
    input_format="pdf",
    output_file="converted.txt",
    output_format="txt"
)

# Convert DOCX to HTML
success = file_converter(
    input_file="document.docx",
    input_format="docx",
    output_file="converted.html",
    output_format="html"
)
```

### Quick Testing
```python
from preeti_unicode import test

# Test string conversion
test("string", "g]kfn")

# Test file conversion capabilities
test("txt")    # Test TXT file conversion
test("pdf")    # Test PDF file conversion
test("docx")   # Test DOCX file conversion
test("all")    # Test all formats
```

## Command Line Interface

### Text Conversion
```bash
# Convert text directly
preeti-unicode text "g]kfn"

# Convert without number conversion
preeti-unicode text "g]kfn @)!&" --no-convert-numbers
```

### File Conversion
```bash
# Convert a single file
preeti-unicode file input.pdf output.txt --output-format txt

# Convert with explicit input format
preeti-unicode file input.pdf output.docx --input-format pdf --output-format docx
```

### Batch Conversion
```bash
# Convert multiple files
preeti-unicode batch *.pdf --input-format pdf --output-format txt --output-dir converted/

# Convert all files in a directory
preeti-unicode batch documents/ --input-format pdf --output-format html --output-dir output/
```

## Testing

The package includes a comprehensive test system that you can use to verify functionality:

```python
from preeti_unicode import test

# Test basic string conversion
test("string")  # Uses default sample text
test("string", "your_preeti_text_here")  # Test with your own text

# Test file format support
test("txt")     # Test TXT file conversion
test("pdf")     # Test PDF file conversion (requires reportlab)
test("docx")    # Test DOCX file conversion (requires python-docx)

# Test everything at once
test("all")     # Comprehensive test of all features
```

## Supported Formats

### Input Formats
- **PDF**: Full support with integrity validation and password protection handling
- **DOCX**: Microsoft Word documents with formatting preservation
- **TXT**: Plain text files with encoding detection

### Output Formats
- **PDF**: Generate Unicode PDF documents
- **DOCX**: Create formatted Word documents
- **TXT**: Plain text output with proper encoding
- **HTML**: Web-ready HTML with proper Unicode rendering

## Contributing

We welcome contributions! Please feel free to submit issues and pull requests.

### Development Setup
```bash
git clone https://github.com/diwaskunwar/preeti-unicode.git
cd preeti-unicode
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e .
```

### Running Tests
```bash
# Run the built-in test suite
python -c "from preeti_unicode import test; test('all')"
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Support

- **Issues**: [GitHub Issues](https://github.com/diwaskunwar/preeti-unicode/issues)
- **Documentation**: Check the docstrings and examples in this README

## Acknowledgments

- Thanks to the Nepali computing community for font specifications
- Built with modern Python packaging standards using uv and proper package structure