Installation
Installation
This page installs Aspose.HTML FOSS for Python and verifies the setup with a minimal DOM round-trip.
Prerequisites
| Requirement | Detail |
|---|---|
| Python | 3.10 or later |
| pip | Any recent version |
| Operating system | Windows, Linux, or macOS |
| Native dependencies | None — pure Python implementation |
1. Create a virtual environment (recommended)
Keep the installation isolated from the system Python:
python -m venv .venvActivate it — on Windows:
.venv\Scripts\activateOn Linux/macOS:
source .venv/bin/activate2. Install the package
Install the current release (0.1.0) from PyPI:
pip install aspose-html-foss3. Verify the installation
Build a one-element document and read a computed style back — if this prints without errors, the install is working:
from aspose_html.dom import Document
from aspose_html.cssom import CSSStyleSheet
doc = Document()
el = doc.create_element("div")
el.set_attribute("id", "bar")
doc.append_child(el)
sheet = CSSStyleSheet()
sheet.replace_sync("#bar { color: blue }")
doc.attach_style_sheet(sheet)
print(el.get_computed_style().get_property_value("color"))Next Steps
- Quickstart — build and style your first real document
- License — MIT licensing details
- Features Overview — what the library covers
- DOM Guide — the document object model in depth