[](https://badge.fury.io/py/mdextractor)
[](https://opensource.org/licenses/MIT)
[](https://pepy.tech/project/mdextractor)
# mdextractor
`mdextractor` is a Python package designed for extracting code blocks from Markdown text. It efficiently identifies blocks enclosed in triple backticks (\`\`\`), optionally preceded by language identifiers, and extracts their contents.
## Installation
To install `mdextractor`, use pip:
```bash
pip install mdextractor
```
## Usage
Using `mdextractor` is straightforward. Here's an example:
```python
from mdextractor import extract_md_blocks
text = """
\`\`\`python
print("Hello, Markdown!")
\`\`\`
"""
blocks = extract_md_blocks(text)
print(blocks)
# Output: ['print("Hello, Markdown!")']
```
This package is useful in various applications where extracting code or preformatted text from Markdown is necessary.
## Features
- Efficient extraction of Markdown code blocks.
- Supports language specifiers following the opening backticks.
- Works with multi-line and single-line code blocks.
- Simple API with a single function call.
## Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://github.com/chigwell/mdextractor/issues).
## License
`mdextractor` is licensed under the [MIT License](https://choosealicense.com/licenses/mit/).
Raw data
{
"_id": null,
"home_page": "https://github.com/chigwell/mdextractor",
"name": "mdextractor",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Eugene Evstafev",
"author_email": "chigwel@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/0b/d9/d45c68710cd078b46f5203a6a12a3c1a89b37e0112b5a15dcdaf9076df69/mdextractor-0.0.3.tar.gz",
"platform": null,
"description": "[](https://badge.fury.io/py/mdextractor)\n[](https://opensource.org/licenses/MIT)\n[](https://pepy.tech/project/mdextractor)\n\n# mdextractor\n\n`mdextractor` is a Python package designed for extracting code blocks from Markdown text. It efficiently identifies blocks enclosed in triple backticks (\\`\\`\\`), optionally preceded by language identifiers, and extracts their contents.\n\n## Installation\n\nTo install `mdextractor`, use pip:\n\n```bash\npip install mdextractor\n```\n\n## Usage\n\nUsing `mdextractor` is straightforward. Here's an example:\n\n```python\nfrom mdextractor import extract_md_blocks\n\ntext = \"\"\"\n\\`\\`\\`python\nprint(\"Hello, Markdown!\")\n\\`\\`\\`\n\"\"\"\n\nblocks = extract_md_blocks(text)\nprint(blocks)\n# Output: ['print(\"Hello, Markdown!\")']\n```\n\nThis package is useful in various applications where extracting code or preformatted text from Markdown is necessary.\n\n## Features\n\n- Efficient extraction of Markdown code blocks.\n- Supports language specifiers following the opening backticks.\n- Works with multi-line and single-line code blocks.\n- Simple API with a single function call.\n\n## Contributing\n\nContributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://github.com/chigwell/mdextractor/issues).\n\n## License\n\n`mdextractor` is licensed under the [MIT License](https://choosealicense.com/licenses/mit/).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Extract Markdown code blocks from text strings.",
"version": "0.0.3",
"project_urls": {
"Homepage": "https://github.com/chigwell/mdextractor"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6b978587f812d005165c8dfa1ecc16260deb8ad3caad189bc455561b7cf89dc9",
"md5": "6f1ba6b12620bad57e9c7e7a749c8790",
"sha256": "230415829692e6d27da4311bf7bf2720c9f1f2ee277f930a230a34dd6431f3f6"
},
"downloads": -1,
"filename": "mdextractor-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6f1ba6b12620bad57e9c7e7a749c8790",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 3966,
"upload_time": "2024-08-20T10:02:02",
"upload_time_iso_8601": "2024-08-20T10:02:02.307689Z",
"url": "https://files.pythonhosted.org/packages/6b/97/8587f812d005165c8dfa1ecc16260deb8ad3caad189bc455561b7cf89dc9/mdextractor-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0bd9d45c68710cd078b46f5203a6a12a3c1a89b37e0112b5a15dcdaf9076df69",
"md5": "b200d55405b66a30453b901e3fab8cef",
"sha256": "7310fa18267025480bac3a35239fab56eb91129c278bc481837212ac81cf897c"
},
"downloads": -1,
"filename": "mdextractor-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "b200d55405b66a30453b901e3fab8cef",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3473,
"upload_time": "2024-08-20T10:02:04",
"upload_time_iso_8601": "2024-08-20T10:02:04.347687Z",
"url": "https://files.pythonhosted.org/packages/0b/d9/d45c68710cd078b46f5203a6a12a3c1a89b37e0112b5a15dcdaf9076df69/mdextractor-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-20 10:02:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "chigwell",
"github_project": "mdextractor",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "mdextractor"
}