Metadata-Version: 2.4
Name: mdextractor
Version: 2025.4.231259
Summary: Extract Markdown code blocks from text strings.
Home-page: https://github.com/chigwell/mdextractor
Author: Eugene Evstafev
Author-email: chigwel@gmail.com
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-python
Dynamic: summary

[![PyPI version](https://badge.fury.io/py/mdextractor.svg)](https://badge.fury.io/py/mdextractor)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://static.pepy.tech/badge/mdextractor)](https://pepy.tech/project/mdextractor)
[![LinkedIn](https://img.shields.io/badge/LinkedIn-blue)](https://www.linkedin.com/in/eugene-evstafev-716669181/)

# 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/).
