Metadata-Version: 2.4
Name: markdown_extract
Version: 0.1.0
Summary: A library to extract sections from Markdown files based on headers.
Author-email: Tongyuan Miao <david.tongyuan@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Tongyuan Miao
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: markdown,parser,extraction,headers
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Markdown Extract

A Simple Python library to parse Markdown files from headers.

## Installation

Clone the repository and install the package (or just use the `markdown_extract` folder).

## Usage

```python
from markdown_extract import MarkdownExtractor

markdown_content = """
# Section 1
Some content here.

## Subsection 1.1
More details.
"""

extractor = MarkdownExtractor(markdown_content)

# Get all content under "Section 1" (including subsections)
section_1 = extractor.get_section("Section 1")
print(section_1)

# Get content specifically under "Subsection 1.1"
subsection = extractor.get_section("Section 1", "Subsection 1.1")
print(subsection)

# You can also use bracket syntax to access sections
# This returns a Section object, which can be converted to string
section_1_bracket = extractor["Section 1"]
print(section_1_bracket)

# Chain brackets to access nested sections
subsection_bracket = extractor["Section 1"]["Subsection 1.1"]
print(subsection_bracket)
```

## Features

- Parses nested Markdown headers.
- Retrieves raw content for any specific section hierarchy.
- Preserves structure when retrieving higher-level sections.
