Metadata-Version: 2.4
Name: docoxide
Version: 0.1.0a1
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Text Processing :: Markup :: HTML
License-File: LICENSE-MIT
License-File: LICENSE-APACHE
Summary: Python bindings for docoxide, a fast HTML to PDF converter written in Rust
Keywords: cli,converter,html,pdf,rust
Author-email: Ronie Martinez <ronmarti18@gmail.com>
License-Expression: MIT OR Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/docoxide/docoxide
Project-URL: Repository, https://github.com/docoxide/docoxide

<p align="center">
  <img src="https://raw.githubusercontent.com/docoxide/docoxide/main/assets/logo.svg" alt="docoxide" width="300">
</p>

# docoxide

Python bindings for [docoxide](https://crates.io/crates/docoxide), a fast, browser-free HTML to PDF converter.

## Install

```sh
pip install docoxide
```

Requires Python 3.9 or newer.

## Library usage

```python
from docoxide import convert

html = "<h1>Hello</h1>"
pdf: bytes = convert(html)

with open("hello.pdf", "wb") as f:
    f.write(pdf)
```

With CSS:

```python
pdf = convert(html, "h1 { color: red; }")
```

## CLI usage

```sh
docoxide --input page.html --output page.pdf
docoxide --input page.html --css style.css --output page.pdf
```

Reads from stdin if `--input` is omitted or set to `-`:

```sh
echo '<h1>Hello</h1>' | docoxide --output hello.pdf
```

