Metadata-Version: 2.4
Name: doc2x
Version: 0.1.0
Summary: doc2x by OmniDoc: translate PDFs and documents with the layout kept, convert any format, extract structure. Python SDK for the OmniDoc API. Website: 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

# doc2x

doc2x by OmniDoc: translate PDF, Word, PowerPoint, LaTeX and more into 38 languages with the layout kept, convert between formats, and extract document structure.

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.

- Website: 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/.
