pylibreoffice
A Python library for handling Microsoft Office documents, built with LibreOfficeKit.
Features
- Convert Microsoft Office documents to PDF
Installation
Requirements
-
Python 3.10 or higher
-
LibreOffice 7.2 or higher
sudo apt-get install -y libreoffice libreoffice-dev libreoffice-dev-doc
- The fonts used in the document must be installed on the system.For example,use Chinese, on Ubuntu, you can install the fonts by running the following command:
sudo apt-get install -y fonts-wqy-zenhei fonts-wqy-microhei xfonts-intl-chinese ttf-wqy-zenhei ttf-wqy-microhei language-pack-zh-hans language-pack-zh-hant && \
sudo dpkg-reconfigure locales && \
sudo update-locale LANG=zh_CN.UTF-8
pip install pylibreoffice
Example
from pylibreoffice.core import PyOffice
class Example:
def __init__(self):
self.office = PyOffice("/usr/lib/libreoffice/program/")
def doc(self):
# Convert the doc file to pdf
print(self.office.save_as("./test.doc", "./test.pdf", "pdf"))
def xls(self):
# Convert the xls file to pdf
print(self.office.save_as("./test.xls", "./test_xls.pdf", "pdf"))
if __name__ == '__main__':
ex = Example()
ex.xls()
ex.doc()
Metadata
Release files for pylibreoffice 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pylibreoffice-0.1.4.tar.gz | 64.2 kB | Without provenance | Details for pylibreoffice-0.1.4.tar.gz |
Release files / pylibreoffice-0.1.4.tar.gz
| Download URL | pylibreoffice-0.1.4.tar.gz |
|---|---|
| Size | 64.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
46ec94cee84ec58134b06f8046171738c258cb8369d78f014725efb53d307108
|
|
BLAKE2b-256 checksum How to use checksums |
fb764820fd5d3bf40d872e4b8ca0f6a03c2d6b4c88e82fdcbf097b21dfe7615b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.0
|
Security for pylibreoffice 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.