Install collective.html2blocks#
This guide shows you how to add collective.html2blocks to your Python project.
The package requires Python 3.12 or later.
Choose the method that matches your project.
Choose the extras you need#
The base package installs the converter only: the functions html_to_blocks(), markdown_to_blocks() and volto_blocks().
Install an extra to add the command line or the HTTP service:
Extra |
Installs |
Needed for |
|---|---|---|
|
|
The |
|
|
The |
|
Both sets |
The command and the service together |
Write the extra in square brackets after the package name, for example collective.html2blocks[server].
If you run html2blocks without its extra, the command prints the name of the extra to install and exits.
pyproject.tomlUse this method for modern Python projects. Add
collective.html2blocksto thedependencieslist in yourpyproject.tomlfile. This approach works with build tools such as uv, Poetry, or any other PEP 621-compliant tool.[project] dependencies = [ "collective.html2blocks", ]
setup.pyUse this method for traditional setuptools projects. Add
collective.html2blocksto theinstall_requireslist in yoursetup.pyfile.setup( # ... install_requires=[ "collective.html2blocks", ], )
requirements.txtUse this method if your project manages dependencies with pip. Add
collective.html2blocksto yourrequirements.txtfile.collective.html2blocks
Reinstall with updated dependencies#
After you change your dependency file, run your project's installation command again.
For example, run pip install -r requirements.txt or uv sync, or use the equivalent command of your build tool.
To learn how to write version constraints, read the Dependency specifiers specification.