Skip to main content

Python Packages

You can view, install, and remove Python packages in the workflow editor.

Note

  • If a required Python package is already installed by a nested extension command that you imported, you can use it directly without installing it again.
  • A package installed by the current application or extension command takes precedence over a package with the same name supplied by a nested extension command. This also applies when the selected version is older.
  • Installed Python packages are included when you export an application (.qya) or extension command (.qyi). After importing the file on another computer, the packages can be used without being installed again.

Example

Extension Command A installs the html2text package.

Extension Command B imports Extension Command A.

Application C imports Extension Command B.

The resulting dependency chain is Application C -> Extension Command B -> Extension Command A -> html2text.

Because Extension Command A supplies html2text, Application C can use the package without installing it again. You may also install html2text in Application C. In that case, the version installed by Application C takes precedence over the version supplied by Extension Command A.

For example:

import html2text

# Sample HTML content
html_content = """
<html>
<body>
<h1>Welcome to HTML to Text conversion</h1>
<p>This is an example of <b>bold</b> text.</p>
<a href="https://example.com">Click here</a> to visit the website.
</body>
</html>
"""

# Create html2text object
h = html2text.HTML2Text()

# Convert HTML to plain text
text_content = h.handle(html_content)

# Output the converted plain text
print_to_app(text_content)