Python CFFI wrapper for LibreOfficeKit
Project description
A python CFFI wrapper for LibreOfficeKit. Tested in cpython2, cpython3, and pypy.
Requirements
An installation of LibreOffice >= 4.3.0 is required on the same machine
Installation
pip install pylokit
Example
A basic conversion from a rtf file to a doc:
from pylokit import Office
lo_path = "/path/to/libreoffice/program/dir"
with Office(lo_path) as lo:
with lo.documentLoad("myfile.rtf") as doc:
doc.saveAs("myfile.doc")
Same conversion passing an explicit format and filter options:
from pylokit import Office
lo_path = "/path/to/libreoffice/program/dir"
with Office(lo_path) as lo:
with lo.documentLoad("myfile.rtf") as doc:
doc.saveAs("myfile.doc", fmt="docx", options="skipImages")
The usage of a context manager is needed to properly handle LibreOfficeKit file locking.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pylokit-0.8.0.tar.gz
(11.1 kB
view details)
File details
Details for the file pylokit-0.8.0.tar.gz
.
File metadata
- Download URL: pylokit-0.8.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c31edc8413ce4b8f052ce56a365490f3d12997ad4b6d749e37260d1db19b72f1 |
|
MD5 | 981751515cf611fdd9a43ae5f973e33b |
|
BLAKE2b-256 | 68848862c018e19194644fdd439ded0ed9aff6ad04c242ffa39551a66e06c12a |