| Crates.io | litchi |
| lib.rs | litchi |
| version | 0.0.1 |
| created_at | 2025-10-19 15:56:59.008183+00 |
| updated_at | 2025-10-19 15:56:59.008183+00 |
| description | High-performance parser for Microsoft Office, OpenDocument, and Apple iWork file formats with unified API |
| homepage | |
| repository | https://github.com/DevExzh/litchi |
| max_upload_size | |
| id | 1890569 |
| size | 3,029,180 |
A high-performance Rust library for parsing Microsoft Office file formats (OLE2 and OOXML), OpenDocument formats (ODF), and Apple iWork files. Supports .doc, .docx, .xls, .xlsx, .ppt, .pptx, .odt, .ods, .odp, .pages, .numbers, and .key files.
[!WARNING] ⚠️ Active Development: This library is under active development. The API may change without notice. Not recommended for production use yet.
[!NOTE] The current logo is generated by AI, we need someone to design a better logo. If you are interested, please contact me via email.
use litchi::{Document, Presentation};
// Microsoft Office formats - format auto-detected
let doc = Document::open("document.doc")?; // .doc or .docx
let text = doc.text()?;
let pres = Presentation::open("slides.ppt")?; // .ppt or .pptx
let slide_count = pres.slide_count()?;
// Excel spreadsheets
use litchi::sheet::open_xls_workbook;
let workbook = open_xls_workbook("spreadsheet.xls")?;
let worksheet = workbook.worksheet_by_name("Sheet1")?;
// OpenDocument formats (requires "odf" feature)
#[cfg(feature = "odf")]
{
use litchi::odf;
let odt = odf::Document::open("document.odt")?;
let text = odt.text()?;
}
// Apple iWork formats (requires "iwa" feature)
#[cfg(feature = "iwa")]
{
use litchi::iwa;
let pages = iwa::Document::open("document.pages")?;
let text = pages.text()?;
}
// Formula conversion (requires "formula" feature)
#[cfg(feature = "formula")]
{
use litchi::formula;
let latex = formula::mathml_to_latex("<math>...</math>")?;
}
Add to your Cargo.toml:
[dependencies]
litchi = "0.0.1"
By default, only Microsoft Office formats are enabled (ole and ooxml features). Enable additional features as needed:
[dependencies]
# Enable all features
litchi = { version = "0.0.1", features = ["odf", "iwa", "formula", "imgconv"] }
# Or enable specific features
litchi = { version = "0.0.1", features = ["odf"] } # OpenDocument support
litchi = { version = "0.0.1", features = ["iwa"] } # Apple iWork support
litchi = { version = "0.0.1", features = ["formula"] } # Formula parsing and LaTeX conversion
litchi = { version = "0.0.1", features = ["imgconv"] } # Image conversion support
Available Features:
ole (default) - Legacy Office formats (.doc, .xls, .ppt)ooxml (default) - Modern Office formats (.docx, .xlsx, .pptx)odf - OpenDocument formats (.odt, .ods, .odp)iwa - Apple iWork formats (.pages, .numbers, .key)formula - MathType and Office MathML to LaTeX conversionimgconv - Image format conversion (EMF, WMF, PICT to PNG/JPEG/WebP)For detailed documentation, API reference, and examples, visit docs.rs/litchi.
Implemented:
Limitations:
See docs.rs/litchi for the complete roadmap and planned features.
Licensed under the Apache License, Version 2.0.
This library is built upon the work of many open-source projects. We are grateful to the following projects for their research, documentation, and reference implementations:
Microsoft Office Formats:
OpenDocument Formats:
Apple iWork Formats:
RTF Formats:
Formula Conversion:
Image Conversion:
Utilities:
Specifications:
All projects retain their original licenses.