It’s not a super-frequent need for me, but sometimes I’d like to be able to accept markdown from users and include the rendered output on my site. This is risky, because markdown can include arbitrary html, and libraries that process it may not focus on making sure it’s safe to include in a site. For a while, bleach was the common recommendation, but it’s deprecated. Since then, the ammonia library, which is written in rust, has emerged as a good functional equivalent of bleach, with a very similar interface. Python bindings are available for that in NH3.