Installation
Installation von Aspose.Note FOSS für Python
Aspose.Note FOSS für Python wird über PyPI unter dem Paketnamen aspose-note verteilt. Die Installation erfordert Python 3.10 oder höher.
1. Standardinstallation (Empfohlen)
Installieren Sie die Kernbibliothek mit pip:
pip install aspose-noteDies installiert das aspose.note‑Paket ohne optionale Abhängigkeiten. Es unterstützt alle Lese‑ und Traversierungsfunktionen. PDF‑Export ist nicht enthalten.
2. Installation mit PDF-Exportunterstützung
Um Document.Save(..., SaveFormat.Pdf) zu aktivieren, installieren Sie das [pdf]‑Extra. Dies fügt die ReportLab-Abhängigkeit hinzu (reportlab>=3.6):
pip install "aspose-note[pdf]"Wenn Sie das Kernpaket bereits installiert haben, aktualisieren Sie es und fügen Sie das Extra in einem Befehl hinzu:
pip install --upgrade "aspose-note[pdf]"Hinweis: Der Versuch,
Document.SavemitSaveFormat.Pdfaufzurufen, ohne dass ReportLab installiert ist, löst zur Laufzeit einenImportErroraus. Installieren Sie das[pdf]-Extra, bevor Sie die PDF‑Funktionalität nutzen.
3. Virtuelle Umgebung (Best Practice)
Verwenden Sie eine virtuelle Umgebung, um die Bibliothek von Ihrem System‑Python zu isolieren:
##Create a virtual environment
python -m venv .venv
##Activate it
##Windows:
.venv\Scripts\activate
##Linux / macOS:
source .venv/bin/activate
##Install (with PDF support)
pip install "aspose-note[pdf]"4. Editierbare Installation (Für Mitwirkende)
Klonen Sie das Repository und installieren Sie es im editierbaren Modus, um zu entwickeln oder Tests gegen die Quelle auszuführen:
git clone https://github.com/aspose-note-foss/Aspose.Note-FOSS-for-Python.git
cd Aspose.Note-FOSS-for-Python
##Editable install with PDF support
pip install -e ".[pdf]"
##Run the test suite
python -m unittest discover -s tests -p "test_*.py" -vVerifizierung
Nach der Installation prüfen Sie, ob das Paket importierbar ist:
from aspose.note import Document, SaveFormat, FileFormat
print("Aspose.Note FOSS for Python installed successfully.")Überprüfen Sie die installierte Version:
pip show aspose-noteErwartete Ausgabe (Version kann abweichen):
Name: aspose-note
Version: 26.3.2
Summary: Aspose.Note-compatible Python API for reading OneNote (.one) files
...Abhängigkeiten
| Abhängigkeit | Erforderlich? | Zweck |
|---|---|---|
| Python 3.10+ | Immer | Mindestsprachversion |
reportlab>=3.6 | Optional (über [pdf] Extra) | PDF-Export über Document.Save(..., SaveFormat.Pdf) |
Die Kernbibliothek hat keine zwingenden Drittanbieter‑Abhängigkeiten. Alle MS-ONE/OneStore‑Binärparsing wird in reinem Python im aspose.note._internal‑Unterpaket implementiert.
Paketdetails
| Attribut | Wert |
|---|---|
| Paketname | aspose-note |
| PyPI-URL | https://pypi.org/project/aspose-note/ |
| Importpfad | from aspose.note import ... |
| Version (aktuell) | 26.3.2 |
| Python-Unterstützung | 3.10, 3.11, 3.12 |
| Betriebssysteme | Windows, Linux, macOS (OS-unabhängig) |
| Lizenz | MIT (Aspose-Split) |
| Quell-Repository | https://github.com/aspose-note-foss/Aspose.Note-FOSS-for-Python |