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:
pip install mdextractor
Usage
Using mdextractor is straightforward. Here's an example:
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.
License
mdextractor is licensed under the MIT License.
Metadata
Release files for mdextractor 2025.4.231259
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mdextractor-2025.4.231259.tar.gz | 3.5 kB | Without provenance | Details for mdextractor-2025.4.231259.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mdextractor-2025.4.231259-py3-none-any.whl | Python 3 | none | any | Details for mdextractor-2025.4.231259-py3-none-any.whl |
Total release size: 7.7 kB
Release files / mdextractor-2025.4.231259.tar.gz
| Download URL | mdextractor-2025.4.231259.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
075658d4e66b463ea755736380c5c6ff7d92abeb4f565d8b8356af1374810016
|
|
BLAKE2b-256 checksum How to use checksums |
a9a74b66f32f38843158c43dfde9d9b9346637e40bd61a8e0c043db1a8c464fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.11
|
Release files / mdextractor-2025.4.231259-py3-none-any.whl
| Download URL | mdextractor-2025.4.231259-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
266f272254c1141b384ccbe773eafc3eb38b4015d159df5d98519fe8a3358b1e
|
|
BLAKE2b-256 checksum How to use checksums |
a03f26e6072dedf73288dc30a2bad5e34bf5c8f669f9deeece659ec6966126a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.11
|
Security for mdextractor 2025.4.231259
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.