PythonPackageModel

class documenteer.conf._toml.PythonPackageModel(**data)

Bases: BaseModel

Model for a Python package (i.e. built with pyproject.toml-compatible build system.

Parameters:

data (Any)

Attributes Summary

model_computed_fields

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config

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

model_fields

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

Methods Summary

validate_package(v)

Ensure the package is importable.

Attributes Documentation

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[Dict[str, FieldInfo]] = {'documentation_url_key': FieldInfo(annotation=str, required=False, default='Homepage', description='Key for the documentation URL in the pyproject.toml [project.urls] table. The corresponding URL is used for the Sphinx html_baseurl configuration, which in turns sets the canonical URL link relation on the web pages.'), 'github_url_key': FieldInfo(annotation=str, required=False, default='Source', description='Key for the documentation URL in the pyproject.toml [project.urls] table. The corresponding URL is used for as an alternative to setting [project.github_url].'), 'package': FieldInfo(annotation=str, required=True, description='Package name')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

Methods Documentation

classmethod validate_package(v)

Ensure the package is importable.

Parameters:

v (str)

Return type:

str