vdoc.models package

Submodules

vdoc.models.project module

Contains all project model definitions.

class vdoc.models.project.Project(**data)

Bases: BaseModel

Pydantic model for a project.

classmethod get_version_and_docs_path(name, version)

Returns the validated version and the path containing the documentation.

Parameters:
  • name (str) – The project name.

  • version (str) – The project version. If latest, the path to the newest version will be returned.

Raises:
Return type:

tuple[str, Path]

Returns:

The validated version and the path containing the documentation.

property latest: str

Returns the latest version available of the project.

Returns:

_description_

classmethod list(search_path=None)

Returns a list of all projects.

Parameters:

search_path (Path | None) – Optional search path. If None, the docs_dir of the settings will be used.

Return type:

list[Project]

Returns:

A a list of all projects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
classmethod validate_project_exists(value)

Validates the project’s existence.

Parameters:

value (str) – The project name.

Raises:

ProjectNotFound – If the project doesn’t exist.

Return type:

str

Returns:

The validated project name.

property versions: Dict[Version, str]

Returns a list of all available project versions.

Raises:

ProjectNotFound – If the project doesn’t exist.

Returns:

A list of all versions of the project.

Module contents

Contains all models.