Project
docforge.models.project
This module defines the Project class, the top-level container for a documented project. It aggregates multiple Module instances into a single named entity.
Project
Project(name: str)
Represents a documentation project, serving as a container for modules.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Name of the project. |
modules |
Dict[str, Module]
|
Dictionary mapping module paths to Module instances. |
Initialize a new Project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str
|
The name of the project. |
required |
add_module
add_module(module: Module) -> None
Add a module to the project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
module |
Module
|
The module to add. |
required |
get_all_modules
get_all_modules() -> Iterable[Module]
Get all modules in the project.
Returns:
| Type | Description |
|---|---|
Iterable[Module]
|
An iterable of Module objects. |
get_module
get_module(path: str) -> Module
Retrieve a module by its dotted path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path |
str
|
The dotted path of the module (e.g., 'pkg.mod'). |
required |
Returns:
| Type | Description |
|---|---|
Module
|
The requested Module. |
get_module_list
get_module_list() -> list[str]
Get the list of all module dotted paths.
Returns:
| Type | Description |
|---|---|
list[str]
|
A list of module paths. |