neopdf/lib.rs
1//! Generate `PyO3` interface for `neopdf`
2
3#![allow(unsafe_op_in_unsafe_fn)]
4
5use pyo3::prelude::*;
6
7/// Python bindings for the `converter` module.
8pub mod converter;
9/// Python bindings for the `gridpdf` module.
10pub mod gridpdf;
11/// Python bindings for the `manage` module.
12pub mod manage;
13/// Python bindings for the `metadata` module.
14pub mod metadata;
15/// Python bindings for the `parser` module.
16pub mod parser;
17/// Python bindings for the `PDF` module.
18pub mod pdf;
19/// Python bindings for the `writer` module.
20pub mod writer;
21
22/// PyO3 Python module that contains all exposed classes from Rust.
23#[pymodule]
24fn neopdf(m: &Bound<'_, PyModule>) -> PyResult<()> {
25 m.add("version", env!("CARGO_PKG_VERSION"))?;
26 pdf::register(m)?;
27 metadata::register(m)?;
28 converter::register(m)?;
29 gridpdf::register(m)?;
30 manage::register(m)?;
31 parser::register(m)?;
32 writer::register(m)?;
33 Ok(())
34}