py2html is distributed as a self-contained installer script rather than a PyPI package. Running the script installs theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nishad12323/py2html/llms.txt
Use this file to discover all available pages before exploring further.
beautifulsoup4 dependency via pip and writes the py2html/ package to your home directory. The whole process takes under a minute and requires no manual file copying.
py2html is not available on PyPI. Running
pip install py2html will not work. You must use the installer script described below, or copy the source file manually as explained in the manual installation section.Prerequisites
- Python 3.6 or newer — the installer script and the library both rely on f-strings and other modern Python features.
- pip — the installer calls
pip install beautifulsoup4on your behalf. Ensure pip is available in the same Python environment you intend to use. - tkinter — the installer displays a small GUI window with a progress bar. tkinter ships with most Python distributions; on Debian/Ubuntu it may require
sudo apt install python3-tk.
Installing with the installer script
Download py2html_installer.py
Grab the installer from the GitHub repository. You can clone the repository or download the file directly:
Run the installer
Execute the script with Python 3:A small Tkinter window labelled Py2html Installer will open.
(Optional) Enable the GUI editor
Before clicking Install, check the Install Py2Html GUI checkbox if you want the visual editor. The GUI editor requires three additional packages that you must install yourself:
| Package | Purpose |
|---|---|
tkinterweb | Embedded HTML preview pane inside the editor |
webview | Full-browser live preview window |
sv_ttk | Sun Valley theme for the editor’s Tkinter widgets |
Click Install and wait
Click the Install button. The installer will:
- Run
pip install beautifulsoup4in a background thread. - Create the directory
~/py2html/(i.e.,py2html/inside your home folder, resolved viaPath.home() / 'py2html'). - Write
~/py2html/__init__.py— this is the py2html library itself. - If the GUI checkbox was checked, also write
~/py2html/py2htmlGUI.py.
Making py2html importable without modifying sys.path
The installer places the library at~/py2html/. Python will not find it automatically unless ~ (your home directory) is on sys.path. Choose one of the approaches below to avoid adding sys.path manipulations to every script.
Option A — Copy into your project
py2html as a local package and import py2html works without any path changes.
Option B — Add the home directory to PYTHONPATH
.bashrc, .zshrc, etc.) to make it permanent.
Manual installation
If you prefer not to run the installer GUI, copy the source file directly:beautifulsoup4 package is the only runtime dependency — it is used by getHTML(format=True) to pretty-print the output.
Dependency summary
| Package | Required for | How to install |
|---|---|---|
beautifulsoup4 | Core library (getHTML(format=True)) | Installed automatically by py2html_installer.py |
tkinterweb | GUI editor preview pane | pip install tkinterweb |
webview | GUI editor live browser preview | pip install webview |
sv_ttk | GUI editor theme | pip install sv_ttk |