Aspose.Words FOSS for Python είναι μια βιβλιοθήκη Python αδειοδοτημένη με MIT για τη φόρτωση και μετατροπή εγγράφων Word. Διαβάζει αρχεία DOCX, DOC, RTF, TXT και Markdown και τα εξάγει σε PDF, Markdown και απλό κείμενο χωρίς να απαιτεί Microsoft Office ή οποιοδήποτε ιδιόκτητο runtime.
Η βιβλιοθήκη παρέχει μια κλάση Document για τη φόρτωση αρχείων και μια μέθοδο save() που δέχεται σταθερές SaveFormat ή αντικείμενα επιλογών αποθήκευσης όπως PdfSaveOptions και MarkdownSaveOptions για λεπτομερή έλεγχο εξόδου.
Εγκαταστήστε με pip install aspose-words-foss>=26.4.0. Η βιβλιοθήκη απαιτεί Python 3.10 ή νεότερη έκδοση και εξαρτάται από olefile, fpdf2 και pydantic. Είναι αδειοδοτημένη με MIT και πλήρως ανοιχτού κώδικα στο GitHub.
Document class.SaveFormat.PDF or PdfSaveOptions.SaveFormat.MARKDOWN or MarkdownSaveOptions.Document.get_text().SaveFormat.TEXT.SaveFormat.MARKDOWN, SaveFormat.PDF, and SaveFormat.TEXT for quick conversion.Aspose.Words FOSS installs with pip install aspose-words-foss. Runtime dependencies (olefile, fpdf2, pydantic) are installed automatically.
The API is straightforward: load a Document from a file path, then call save() with a target path and format. For advanced control, pass a save-options object instead of a format constant. The library is MIT-licensed, open-source on GitHub, and requires Python 3.10 or later.
Load a Word document and save it as Markdown in two lines of code.
import aspose.words_foss as aw
doc = aw.Document("input.docx") # or .doc, .rtf, .txt, .md
doc.save("output.md", aw.SaveFormat.MARKDOWN)
Export a Word document to PDF format.
import aspose.words_foss as aw
doc = aw.Document("input.docx")
doc.save("output.pdf", aw.SaveFormat.PDF)
Read all text content from a Word document.
import aspose.words_foss as aw
doc = aw.Document("input.docx")
text = doc.get_text()
Aspose.Words FOSS for Python is released under the MIT license. You can use, modify, and distribute it in commercial and personal projects.
Install via pip with pip install aspose-words-foss>=26.4.0. Requires Python 3.10 or later.
The library reads DOCX, DOC, RTF, TXT, and Markdown files and exports to PDF, Markdown, and plain text.
Load with Document("input.docx") and call doc.save("output.pdf", SaveFormat.PDF).