> ## Documentation Index
> Fetch the complete documentation index at: https://mdxify.zzstoatzz.io/llms.txt
> Use this file to discover all available pages before exploring further.

# parser

# `mdxify.parser`

AST-based module parsing functionality.

## Functions

### `extract_docstring` <sup><a href="https://github.com/zzstoatzz/mdxify/blob/main/src/mdxify/parser.py#L12" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
extract_docstring(node: ast.AST) -> str
```

Extract docstring from an AST node.

### `format_arg` <sup><a href="https://github.com/zzstoatzz/mdxify/blob/main/src/mdxify/parser.py#L29" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
format_arg(arg: ast.arg) -> str
```

Format a function argument.

### `extract_function_signature` <sup><a href="https://github.com/zzstoatzz/mdxify/blob/main/src/mdxify/parser.py#L37" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
extract_function_signature(node: ast.FunctionDef | ast.AsyncFunctionDef) -> str
```

Extract function signature.

### `extract_base_classes` <sup><a href="https://github.com/zzstoatzz/mdxify/blob/main/src/mdxify/parser.py#L68" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
extract_base_classes(node: ast.ClassDef) -> list[str]
```

Extract base class names from a class definition.

### `extract_methods_from_class` <sup><a href="https://github.com/zzstoatzz/mdxify/blob/main/src/mdxify/parser.py#L87" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
extract_methods_from_class(node: ast.ClassDef, include_internal: bool = False) -> list[dict[str, Any]]
```

Extract methods from a class definition.

### `parse_module_fast` <sup><a href="https://github.com/zzstoatzz/mdxify/blob/main/src/mdxify/parser.py#L167" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
parse_module_fast(module_name: str, source_file: Path, include_internal: bool = False, class_registry: ClassRegistry | None = None) -> dict[str, Any]
```

Parse a module quickly using AST.

### `parse_modules_with_inheritance` <sup><a href="https://github.com/zzstoatzz/mdxify/blob/main/src/mdxify/parser.py#L224" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
parse_modules_with_inheritance(modules_to_process: list[str], include_internal: bool = False) -> dict[str, dict[str, Any]]
```

Parse multiple modules with inheritance support, including parent classes in private modules.

## Classes

### `ClassRegistry` <sup><a href="https://github.com/zzstoatzz/mdxify/blob/main/src/mdxify/parser.py#L103" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Registry for tracking classes and their inheritance relationships.

**Methods:**

#### `add_class` <sup><a href="https://github.com/zzstoatzz/mdxify/blob/main/src/mdxify/parser.py#L111" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
add_class(self, module_name: str, class_name: str, class_info: dict[str, Any], source_file: Optional[str] = None)
```

Add a class to the registry.

#### `get_class` <sup><a href="https://github.com/zzstoatzz/mdxify/blob/main/src/mdxify/parser.py#L121" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
get_class(self, class_name: str) -> dict[str, Any] | None
```

Get a class by its full name.

#### `find_class_in_modules` <sup><a href="https://github.com/zzstoatzz/mdxify/blob/main/src/mdxify/parser.py#L125" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
find_class_in_modules(self, class_name: str, modules: list[str]) -> str | None
```

Find a class by name across a list of modules.

#### `get_inherited_methods` <sup><a href="https://github.com/zzstoatzz/mdxify/blob/main/src/mdxify/parser.py#L133" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
get_inherited_methods(self, class_name: str, include_internal: bool = False) -> list[dict[str, Any]]
```

Get inherited methods for a class.
