Metadata-Version: 2.4
Name: document-svg
Version: 0.1.1
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Rust
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Requires-Dist: pytest>=8,<10 ; extra == 'test'
Provides-Extra: test
License-File: legal/LICENSE
License-File: legal/LICENSE-MIT
License-File: legal/LICENSE-APACHE
License-File: legal/THIRD_PARTY_NOTICES.md
License-File: legal/THIRD_PARTY_LICENSES.txt
Summary: Fast PDF/OOXML to SVG conversion and SVG to OOXML packaging powered by Rust
License-Expression: MIT OR Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# document-svg for Python

Python bindings for the Rust `document-svg` converter.

## Install

Requires Python 3.10+ (GIL-enabled CPython). In your virtual environment:

```sh
python -m pip install document-svg
```

Install `document-svg`, but import `document_svg`. Matching prebuilt wheels do
not require Rust. Prebuilt wheels cover Windows, macOS and glibc-based Linux on
x64 and ARM64. Alpine/musl installations build from source and need Rust plus
native build tools; this release does not ship musllinux wheels.
This package provides a Python API, not the `docsvg` CLI.

## Convert a document

```python
from document_svg import convert

report = convert("slides.pptx", "output", jobs=4)
print(report["page_count"])

fidelity = convert(
    "input.pdf",
    "output-fidelity",
    outline_embedded_pdf_text=True,
)
```

Package SVG pages as vector images in PPTX, DOCX or XLSX:

```python
from document_svg import reverse

report = reverse("svg-pages", "slides.pptx")
print(report["page_count"])
```

The input is a single SVG or a directory of SVG pages. This does not reconstruct
the original paragraphs, cells, formulas or other Office semantics.

Inspect the returned warnings before relying on conversion fidelity. Output
directories for conversion must be new or empty.

## Build from source

Build a local wheel from this directory:

```bash
python -m pip wheel --no-deps --wheel-dir dist .
```

Publish the generated wheels for each supported operating system and CPU to
PyPI. End users do not need a Rust toolchain when a matching wheel is present.

