Name | marko JSON |
Version |
2.2.0
JSON |
| download |
home_page | None |
Summary | A markdown parser with high extensibility. |
upload_time | 2025-08-08 09:47:05 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 𝓜𝓪𝓻𝓴𝓸
> A markdown parser with high extensibility.
[](https://pypi.org/project/marko/)
[](https://pypi.org/project/marko/)
[](https://marko-py.readthedocs.io/en/latest/?badge=latest)
[][spec]

[](https://codecov.io/gh/frostming/marko)
[](https://www.codacy.com/app/frostming/marko?utm_source=github.com&utm_medium=referral&utm_content=frostming/marko&utm_campaign=Badge_Grade)
Marko is a pure Python markdown parser that adheres to the specifications of [CommonMark's spec v0.31.2][spec]. It has been designed with high extensibility in mind, as detailed in the [Extensions](#extensions) section.
Marko requires Python 3.8 or higher.
## Why Marko
Of all the Python markdown parsers available, a common issue is the difficulty for users to add their own features. Additionally, both [Python-Markdown][pymd] and [mistune][mistune] do not comply with CommonMark specifications. This has prompted me to develop a new markdown parser.
Marko's compliance with the complex CommonMark specification can impact its performance. However, using a parser that does not adhere to this spec may result in unexpected rendering outcomes. According to benchmark results, Marko is three times slower than Python-Markdown but slightly faster than Commonmark-py and significantly slower than mistune. If prioritizing performance over spec compliance is crucial for you, it would be best to opt for another parser.
[spec]: https://spec.commonmark.org/0.31.2/
[pymd]: https://github.com/waylan/Python-Markdown
[mistune]: https://github.com/lepture/mistune
[cmpy]: https://github.com/rtfd/CommonMark-py
## Use Marko
The installation is very simple:
$ pip install marko
And to use it:
```python
import marko
print(marko.convert(text))
```
Marko also provides a simple CLI, for example, to render a document and output to a html file:
$ cat my_article.md | marko > my_article.html
## Extensions
It is super easy to use an extension:
```python
from marko import Markdown
from marko.ext.footnote import make_extension
# Add footnote extension
markdown = Markdown(extensions=[make_extension()])
# Or you can just:
markdown = Markdown(extensions=['footnote'])
# Alternatively you can register an extension later
markdown.use(make_extension())
```
An example of using an extension with the command-line version of Marko:
```
$ cat this_has_footnote.txt | marko -e footnote > hi_world.html
```
Marko is shipped with 4 extensions: `'footnote', 'toc' 'pangu', 'codehilite'`.
They are not included in CommonMark's spec but are common in other markdown parsers.
Marko also provides a Github flavored markdown parser which can be found at `marko.ext.gfm.gfm`.
Please refer to [Extend Marko](https://marko-py.readthedocs.io/en/latest/extend.html) about how to
write your own extension.
## License
Marko is released under [MIT License](LICENSE)
## [Change Log](CHANGELOG.md)
Raw data
{
"_id": null,
"home_page": null,
"name": "marko",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Frost Ming <mianghong@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/9c/6a/32545d2379822fb9a8843f01150011402888492541977a1193fe8d695df0/marko-2.2.0.tar.gz",
"platform": null,
"description": "# \ud835\udcdc\ud835\udcea\ud835\udcfb\ud835\udcf4\ud835\udcf8\n\n> A markdown parser with high extensibility.\n\n[](https://pypi.org/project/marko/)\n[](https://pypi.org/project/marko/)\n[](https://marko-py.readthedocs.io/en/latest/?badge=latest)\n[][spec]\n\n\n[](https://codecov.io/gh/frostming/marko)\n[](https://www.codacy.com/app/frostming/marko?utm_source=github.com&utm_medium=referral&utm_content=frostming/marko&utm_campaign=Badge_Grade)\n\nMarko is a pure Python markdown parser that adheres to the specifications of [CommonMark's spec v0.31.2][spec]. It has been designed with high extensibility in mind, as detailed in the [Extensions](#extensions) section.\n\nMarko requires Python 3.8 or higher.\n\n## Why Marko\n\nOf all the Python markdown parsers available, a common issue is the difficulty for users to add their own features. Additionally, both [Python-Markdown][pymd] and [mistune][mistune] do not comply with CommonMark specifications. This has prompted me to develop a new markdown parser.\n\nMarko's compliance with the complex CommonMark specification can impact its performance. However, using a parser that does not adhere to this spec may result in unexpected rendering outcomes. According to benchmark results, Marko is three times slower than Python-Markdown but slightly faster than Commonmark-py and significantly slower than mistune. If prioritizing performance over spec compliance is crucial for you, it would be best to opt for another parser.\n\n[spec]: https://spec.commonmark.org/0.31.2/\n[pymd]: https://github.com/waylan/Python-Markdown\n[mistune]: https://github.com/lepture/mistune\n[cmpy]: https://github.com/rtfd/CommonMark-py\n\n## Use Marko\n\nThe installation is very simple:\n\n $ pip install marko\n\nAnd to use it:\n\n```python\nimport marko\n\nprint(marko.convert(text))\n```\n\nMarko also provides a simple CLI, for example, to render a document and output to a html file:\n\n $ cat my_article.md | marko > my_article.html\n\n## Extensions\n\nIt is super easy to use an extension:\n\n```python\nfrom marko import Markdown\nfrom marko.ext.footnote import make_extension\n# Add footnote extension\nmarkdown = Markdown(extensions=[make_extension()])\n# Or you can just:\nmarkdown = Markdown(extensions=['footnote'])\n# Alternatively you can register an extension later\nmarkdown.use(make_extension())\n```\n\nAn example of using an extension with the command-line version of Marko:\n\n```\n$ cat this_has_footnote.txt | marko -e footnote > hi_world.html\n```\n\nMarko is shipped with 4 extensions: `'footnote', 'toc' 'pangu', 'codehilite'`.\nThey are not included in CommonMark's spec but are common in other markdown parsers.\n\nMarko also provides a Github flavored markdown parser which can be found at `marko.ext.gfm.gfm`.\n\nPlease refer to [Extend Marko](https://marko-py.readthedocs.io/en/latest/extend.html) about how to\nwrite your own extension.\n\n## License\n\nMarko is released under [MIT License](LICENSE)\n\n## [Change Log](CHANGELOG.md)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A markdown parser with high extensibility.",
"version": "2.2.0",
"project_urls": {
"Documentation": "https://marko-py.readthedocs.io",
"homepage": "https://github.com/frostming/marko"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "94b187f54d8842b2aafdbb162301ac730587e04f30ad0fe9aabb12fa29f7a6f7",
"md5": "fb87708209e5d0c093a4b5efff6a6635",
"sha256": "d84f867429142627e896322c8ef167664f3a6cd6ea5a2b70c6af055998041bb7"
},
"downloads": -1,
"filename": "marko-2.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fb87708209e5d0c093a4b5efff6a6635",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 42683,
"upload_time": "2025-08-08T09:47:04",
"upload_time_iso_8601": "2025-08-08T09:47:04.175470Z",
"url": "https://files.pythonhosted.org/packages/94/b1/87f54d8842b2aafdbb162301ac730587e04f30ad0fe9aabb12fa29f7a6f7/marko-2.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9c6a32545d2379822fb9a8843f01150011402888492541977a1193fe8d695df0",
"md5": "069303b91bba57bc57841b611e2c8884",
"sha256": "213c146ba197c1d6bcb06ae3658b7d87e45f6def35c09905b86aa6bb1984eba6"
},
"downloads": -1,
"filename": "marko-2.2.0.tar.gz",
"has_sig": false,
"md5_digest": "069303b91bba57bc57841b611e2c8884",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 143406,
"upload_time": "2025-08-08T09:47:05",
"upload_time_iso_8601": "2025-08-08T09:47:05.396547Z",
"url": "https://files.pythonhosted.org/packages/9c/6a/32545d2379822fb9a8843f01150011402888492541977a1193fe8d695df0/marko-2.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-08 09:47:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "frostming",
"github_project": "marko",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "marko"
}