Skip to content

Project

docforge.models.project

Summary

Documentation model representing a project.

This module defines the Project class, the top-level container used by doc-forge to represent a documented codebase. A Project aggregates multiple modules and provides access to them through a unified interface.

Classes

Project

Project(name: str)

Representation of a documentation project.

A Project serves as the root container for all modules discovered during introspection. Each module is stored by its dotted import path.

Attributes:

Name Type Description
name str

Name of the project.

modules Dict[str, Module]

Mapping of module paths to Module instances.

Initialize a Project instance.

Parameters:

Name Type Description Default
name str

Name used to identify the documentation project.

required
Functions
add_module
add_module(module: Module) -> None

Register a module in the project.

Parameters:

Name Type Description Default
module Module

Module instance to add to the project.

required
get_all_modules
get_all_modules() -> Iterable[Module]

Return all modules contained in the project.

Returns:

Type Description
Iterable[Module]

Iterable[Module]: An iterable of Module instances.

get_module
get_module(path: str) -> Module

Retrieve a module by its dotted path.

Parameters:

Name Type Description Default
path str

Fully qualified dotted module path (for example pkg.module).

required

Returns:

Name Type Description
Module Module

The corresponding Module instance.

Raises:

Type Description
KeyError

If the module does not exist in the project.

get_module_list
get_module_list() -> list[str]

Return the list of module import paths.

Returns:

Type Description
list[str]

list[str]: A list containing the dotted paths of all modules in the project.