{"id":898,"library":"markdownify","title":"Markdownify","description":"Markdownify is a Python library designed to convert HTML content into Markdown format. It is currently at version 1.2.2 and maintains an active development status with a healthy release cadence, frequently adding new features and addressing issues.","status":"active","version":"1.2.2","language":"python","source_language":"en","source_url":"http://github.com/matthewwithanm/python-markdownify","tags":["html-to-markdown","conversion","html","markdown","web-scraping","document-processing"],"install":[{"cmd":"pip install markdownify","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core dependency for parsing HTML documents.","package":"beautifulsoup4","optional":false},{"reason":"Dependency for Python 2/3 compatibility.","package":"six","optional":false}],"imports":[{"symbol":"markdownify","correct":"from markdownify import markdownify as md"}],"quickstart":{"code":"from markdownify import markdownify as md\n\nhtml_content = \"<h1>Hello World</h1><p>This is <b>bold</b> and <em>italic</em> text with a <a href=\\\"http://example.com\\\">link</a>.</p>\"\nmarkdown_output = md(html_content)\nprint(markdown_output)","lang":"python","description":"Convert a basic HTML string to Markdown. The `markdownify` function can be aliased as `md` for convenience."},"warnings":[{"fix":"Review the official documentation or GitHub release notes for version 1.0.0 (specifically PR #191) to understand the new function signature and adapt your custom converters accordingly.","message":"The interface for custom tag conversion functions (e.g., `convert_*()`) changed significantly in version 1.0.0. If you have custom conversion logic, it will need to be updated.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Choose either the `strip` option to define tags to remove, or the `convert` option to define tags to specifically process. Do not supply both arguments in the same call.","message":"The `strip` and `convert` options for `markdownify` are mutually exclusive. You cannot use both simultaneously.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure the format of the `beautiful_soup_parser` argument matches the intended use: pass a string/list for parser features or a dictionary for direct BeautifulSoup constructor kwargs.","message":"When customizing BeautifulSoup parser options via the `beautiful_soup_parser` argument (added in v1.2.0), string or list values are treated as 'features' (e.g., 'lxml', 'html5lib'), while dictionary values are treated as full keyword arguments for the BeautifulSoup constructor.","severity":"gotcha","affected_versions":">=1.2.0"},{"fix":"Pass `escape_asterisks=False` and/or `escape_underscores=False` as keyword arguments to the `markdownify` function if you want to prevent these characters from being escaped.","message":"By default, `markdownify` escapes asterisks (`*`) and underscores (`_`) that might be interpreted as Markdown formatting. If you want to disable this behavior, you need to explicitly set `escape_asterisks=False` or `escape_underscores=False`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'1.2.2':20 'activ':24 'ad':33 'address':37 'cadenc':31 'content':11 'convers':43 'convert':9 'current':17 'design':7 'develop':25 'document':50 'document-process':49 'featur':35 'format':14 'frequent':32 'healthi':29 'html':10,40,44 'html-to-markdown':39 'issu':38 'librari':6 'maintain':22 'markdown':13,42,45 'markdownifi':1,2 'new':34 'process':51 'python':5 'releas':30 'scrape':48 'status':26 'version':19 'web':47 'web-scrap':46","created_at":"2026-03-29T06:06:46.885542+00:00","updated_at":"2026-04-16T16:26:22.753729+00:00","problems":[{"fix":"Install the package using pip: `pip install markdownify`","cause":"The `markdownify` library has not been installed in your Python environment, or the environment you are running your code in does not have it installed.","error":"ModuleNotFoundError: No module named 'markdownify'"},{"fix":"Ensure that the input to the `markdownify` function is always a string containing HTML content. For example, `markdownify('')` for an empty string or `markdownify(html_content_variable)` where `html_content_variable` holds a string.","cause":"This error occurs when `markdownify` is called with `None` instead of a string, as the library expects HTML content as a string input to its primary function. A similar `AttributeError` like `'int' object has no attribute 'strip'` would occur if an integer or another non-string type were passed.","error":"AttributeError: 'NoneType' object has no attribute 'strip'"},{"fix":"Choose either the `strip` option or the `convert` option, but not both, when calling the `markdownify` function. For example, `markdownify(html, strip=['script'])` or `markdownify(html, convert=['b', 'i'])`.","cause":"The `markdownify` library does not allow both the `strip` (blacklist of tags to remove) and `convert` (whitelist of tags to keep) options to be used simultaneously, as they define conflicting strategies for tag handling.","error":"ValueError: The `strip` and `convert` options are mutually exclusive."}],"ecosystem":"pypi","meta_description":null,"install_score":100,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.2.3","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"http://github.com/matthewwithanm/python-markdownify","docs":null,"changelog":null,"pypi":"https://pypi.org/project/markdownify/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-27","next_check":"2026-07-28","install_tag":"verified"}}