semvec/pypi-packages huggingface dataset:
doc2mark 0.4.3
Unified document processing with AI-powered OCR
License: MIT
Requires Python: >=3.8
Keywords: document-processing, ocr, pdf, docx, xlsx, pptx, ai, gpt-4, openai, langchain, document-extraction, text-extraction

# doc2mark

[![PyPI version](https://img.shields.io/pypi/v/doc2mark.svg)](https://pypi.org/project/doc2mark/)
[![Python](https://img.shields.io/pypi/pyversions/doc2mark.svg)](https://pypi.org/project/doc2mark/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Turn any document into clean Markdown – in one line.

## Why doc2mark?

- Converts PDFs, DOCX/XLSX/PPTX, images, HTML, CSV/JSON, and more
- AI OCR for scans and screenshots (OpenAI)
- Preserves complex tables (merged cells, headers) and basic layout
- One simple API + CLI for single files or whole folders

## Install

```bash
pip install doc2mark[all]
```

## Try it in 30 seconds

```python
from doc2mark import UnifiedDocumentLoader

loader = UnifiedDocumentLoader(ocr_provider='openai')  # or None
result = loader.load('sample_documents/sample_pdf.pdf', extract_images=True, ocr_images=True)
print(result.content)
```

CLI:

```bash
# single file → stdout
doc2mark sample_documents/sample_document.docx

# directory → save files (recursively)
doc2mark sample_documents -o output -r

# enable OCR with OpenAI
export OPENAI_API_KEY=sk-...        # Windows: set OPENAI_API_KEY=...
doc2mark sample_documents/sample_pdf.pdf --ocr openai --ocr-images
```

## Supported formats

- PDF • DOCX • XLSX • PPTX • Images (PNG/JPG/WEBP) • TXT/CSV/TSV/JSON/JSONL • HTML/XML/MD
- Legacy Office (DOC/XLS/PPT/RTF/PPS) via LibreOffice (optional)

## Common recipes

```python
from doc2mark import UnifiedDocumentLoader

loader = UnifiedDocumentLoader(ocr_provider='openai')

# 1) Single file → Markdown string
print(loader.load('document.pdf').content)

# 2) Image with OCR
print(loader.load('screenshot.png', extract_images=True, ocr_images=True).content)

# 3) Batch a folder and save outputs
loader.batch_process(
    input_dir='documents/',
    output_dir='converted/',
    extract_images=True,
    ocr_images=True,
    show_progress=True,
    save_files=True
)
```

## OpenAI OCR (optional)

```bash
export OPENAI_API_KEY=your_key   # Windows: set OPENAI_API_KEY=your_key
```

```python
loader = UnifiedDocumentLoader(ocr_provider='openai')
# Need a cheaper model? Use model='gpt-4o-mini'
```

Use OpenAI‑compatible endpoints (self‑hosted/offline VLM):

```python
# Example: point to an OpenAI‑compatible server (must support vision)
loader = UnifiedDocumentLoader(
    ocr_provider='openai',
    base_url='http://localhost:11434/v1',  # your OpenAI‑compatible endpoint
    api_key='your-key-or-any-string',      # some servers require a token
    model='gpt-4o-mini'
)
```

## Tips

- Use `extract_images=True, ocr_images=True` to convert images to text
- `batch_process(..., save_files=True)` writes `.md` (and `.json` when requested)
- Sample files live in `sample_documents/` — perfect for a quick test

## License

MIT — see `LICENSE`.
voicely 5.0.0
Voicely is a lightweight Python library that converts audio files → text and optionally translates the extracted text
License: MIT
Requires Python: >=3.6

<p align="center">
    <img align="center" width="300" src="https://github.com/user-attachments/assets/1805d349-d03a-4087-aeca-2ed57a1b133a" />
    <h3 align="center"></h3>
</p>

<p align="center">
  <a href="https://pypi.org/project/voicely/">
    <img src="https://img.shields.io/pypi/v/voicely.svg?logo=python&logoColor=%23959DA5&label=pypi&labelColor=%23282f37">
  </a>
  
  <a href="https://t.me/PyCodz">
    <img src="https://img.shields.io/badge/Telegram-Channel-blue.svg?logo=telegram">
  </a>
    
  <a href="https://t.me/PyChTz" target="_blank">
    <img alt="Telegram-Discuss" src="https://img.shields.io/badge/Telegram-Discuss-blue.svg?logo=telegram" />
  </a>
</p>

<p align="center">

  <a href="https://pepy.tech/projects/voicely/">
    <img src="https://static.pepy.tech/personalized-badge/voicely?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads">
  </a>

  <a href="https://github.com/DevZ44d/voicely?tab=MIT-1-ov-file">
    <img src="https://camo.githubusercontent.com/30aa09995ff273a3a2a8abf7c116c6fadfb4737b6aac74fe8dcb03e93d855fef/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7a3434642f79746d757369632d626f74">
  </a>
</p>

### 📘 voicely — Audio-to-Text + Translation for Python
> **Voicely** is a lightweight Python library that converts audio files → text and optionally translates the extracted text .

### 🚀 Features
- 🎤 Audio → Text .

- 🌍 Automatic translation using Google Translate endpoint .

- 🔁 Supports any target language .

- ⚡ Fast, minimal, and dependency-light .

- 🧩 Simple class-based interface .


### 📦 Installation

- Clone the project:
```shell
git clone https://github.com/DevZ44d/voicely.git
```

- Via PyPi
```shell
pip install voicely -U
```

### 🧠 Usage Example
- 🔊 Convert audio to text + translate to Arabic
```python
from voicely import Audio
def main() -> str:
    audio = Audio(
        audio="audio.mp3", # Hello, How are you ?
        Translation_To="ar"
    )
    
    print(audio.start())  # → returns translated text
    print(audio.extract_text) # → returns extract text → Hello, How are you ?
    
if __name__ == '__main__':
  main()
```

### Class Translation

- Simple Google Translate wrapper.
```python
from voicely.translation import Translation
T: str = Translation("ar" , "Hello, How are you ?")
# ar → arabic , en → english , ...
print(T["Text"])
# or
print(T.get())
```

- 📝 Output Example
```text
مرحبا, كيف حالك ؟
```

### 💬 Help & Support .
- Follow updates via the **[Telegram Channel](https://t.me/Pycodz)**.
- For general questions and help, join our **[Telegram chat](https://t.me/PyChTz)**.