Metadata-Version: 2.4
Name: doc2x
Version: 0.1.1
Summary: doc2x is a companion tool of OmniDoc, the powerful AI document suite: layout-preserving translation, any-format conversion and structure extraction. Official site: https://omnidoc.top/
Project-URL: Homepage, https://omnidoc.top/
Project-URL: Homepage (China), https://omnidoc.cn/
Project-URL: Documentation, https://docs.omnidoc.top/
Project-URL: Chrome extension, https://chromewebstore.google.com/detail/doc2x/jkdchmlkdknpilamfbpkimelgggoceee
Project-URL: Microsoft Store, https://apps.microsoft.com/detail/9nvx1zb1v48v
Keywords: doc2x,omnidoc,document translation,pdf translation,translate pdf,pdf to word,layout preserved,document conversion,content extraction,api client
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: omnidoc>=0.1.7

<p align="center">
  <a href="https://omnidoc.top/"><img src="https://omnidoc.top/icon-512.png" alt="OmniDoc" width="120"></a>
</p>

# doc2x

doc2x is a companion tool of [OmniDoc](https://omnidoc.top/), the powerful AI document suite. It translates PDF, Word, PowerPoint, LaTeX and more into 38 languages with the layout kept, converts between formats, and extracts document structure.

Official site: **https://omnidoc.top/**

This package is the doc2x Python SDK. It installs the [`omnidoc`](https://pypi.org/project/omnidoc/) SDK and exposes the same API, so both packages work the same way.

- Official site: https://omnidoc.top/ (China: https://omnidoc.cn/)
- API documentation: https://docs.omnidoc.top/
- doc2x Chrome extension: https://chromewebstore.google.com/detail/doc2x/jkdchmlkdknpilamfbpkimelgggoceee
- doc2x on Microsoft Store: https://apps.microsoft.com/detail/9nvx1zb1v48v

Not affiliated with other products that use the name Doc2X.

## Install

```bash
pip install doc2x
```

Requires Python 3.9 or newer.

## Quick start

Create an API key (it starts with `sk_`) in the API center at https://omnidoc.top/app/api-keys and put it in the environment:

```bash
export OMNIDOC_API_KEY="sk_your_key"
```

```python
from doc2x import Doc2XClient

client = Doc2XClient()  # reads OMNIDOC_API_KEY
files = client.translate_file("report.pdf", "en", output_dir="out", output_mode="bilingual")
print(files)
```

`Doc2XClient` is the same class as `omnidoc.OmniDocClient`. For every method, error type and webhook helper, see the [omnidoc documentation](https://pypi.org/project/omnidoc/) and https://docs.omnidoc.top/.
