Using it is simple:
from carta import convert
html = "<p><em>Hello</em> world!</p>"
markdown = convert(html).from_html.to_markdown()
markdown_with_options = convert(html).from_html.to_markdown(
toc=True,
wrap="None",
)
with open("example.docx", "rb") as f:
html = convert(f).from_docx.to_html()
with open("example.docx", "wb") as f:
docx = convert(html).from_html.to_docx()
f.write(docx)