betty.project module

Provide the project API.

class betty.project.EntityReference(entity_type=None, entity_id=None, *, entity_type_is_constrained=False)[source]

Bases: Configuration, Generic[EntityT]

Parameters:
entity_type=None

entity_id=None

entity_type_is_constrained=False

dump()[source]

Dump this instance to a portable format.

Return type:

typing.Union[bool, int, float, str, None, typing.Sequence[typing.Union[bool, int, float, str, None, typing.Sequence[Dump], typing.Mapping[str, Dump]]], typing.Mapping[str, typing.Union[bool, int, float, str, None, typing.Sequence[Dump], typing.Mapping[str, Dump]]], type[betty.serde.dump.Void]]

property entity_id : str | None
property entity_type : type[EntityT] | None
property entity_type_is_constrained : bool
classmethod load(dump, configuration=None)[source]

Load dumped configuration into a new configuration instance.

Parameters:
dump

configuration=None

Return type:

typing.Self

update(other)[source]
Parameters:
other

Return type:

None

class betty.project.EntityReferenceSequence(entity_references=None, *, entity_type_constraint=None)[source]

Bases: Generic[EntityT], ConfigurationSequence[EntityReference[EntityT]]

Parameters:
entity_references=None

entity_type_constraint=None

class betty.project.EntityTypeConfiguration(entity_type, *, generate_html_list=None)[source]

Bases: Configuration

Parameters:
entity_type

generate_html_list=None

dump()[source]

Dump this instance to a portable format.

Return type:

typing.Union[bool, int, float, str, None, typing.Sequence[typing.Union[bool, int, float, str, None, typing.Sequence[Dump], typing.Mapping[str, Dump]]], typing.Mapping[str, typing.Union[bool, int, float, str, None, typing.Sequence[Dump], typing.Mapping[str, Dump]]], type[betty.serde.dump.Void]]

property entity_type : type[Entity]
property generate_html_list : bool
classmethod load(dump, configuration=None)[source]

Load dumped configuration into a new configuration instance.

Parameters:
dump

configuration=None

Return type:

typing.Self

update(other)[source]
Parameters:
other

Return type:

None

class betty.project.EntityTypeConfigurationMapping(configurations=None)[source]

Bases: ConfigurationMapping[type[Entity], EntityTypeConfiguration]

Parameters:
configurations=None

class betty.project.ExtensionConfiguration(extension_type, *, enabled=True, extension_configuration=None)[source]

Bases: Configuration

Parameters:
extension_type

enabled=True

extension_configuration=None

dump()[source]

Dump this instance to a portable format.

Return type:

typing.Union[bool, int, float, str, None, typing.Sequence[typing.Union[bool, int, float, str, None, typing.Sequence[Dump], typing.Mapping[str, Dump]]], typing.Mapping[str, typing.Union[bool, int, float, str, None, typing.Sequence[Dump], typing.Mapping[str, Dump]]], type[betty.serde.dump.Void]]

property enabled : bool
property extension_configuration : Configuration | None
property extension_type : type[Extension]
classmethod load(dump, configuration=None)[source]

Load dumped configuration into a new configuration instance.

Parameters:
dump

configuration=None

Return type:

typing.Self

update(other)[source]
Parameters:
other

Return type:

None

class betty.project.ExtensionConfigurationMapping(configurations=None)[source]

Bases: ConfigurationMapping[type[Extension], ExtensionConfiguration]

Parameters:
configurations=None

disable(*extension_types)[source]
Parameters:
*extension_types

Return type:

None

enable(*extension_types)[source]
Parameters:
*extension_types

Return type:

None

class betty.project.LocaleConfiguration(locale, *, alias=None)[source]

Bases: Configuration

Parameters:
locale

alias=None

property alias : str
dump()[source]

Dump this instance to a portable format.

Return type:

typing.Union[bool, int, float, str, None, typing.Sequence[typing.Union[bool, int, float, str, None, typing.Sequence[Dump], typing.Mapping[str, Dump]]], typing.Mapping[str, typing.Union[bool, int, float, str, None, typing.Sequence[Dump], typing.Mapping[str, Dump]]], type[betty.serde.dump.Void]]

classmethod load(dump, configuration=None)[source]

Load dumped configuration into a new configuration instance.

Parameters:
dump

configuration=None

Return type:

typing.Self

property locale : str
update(other)[source]
Parameters:
other

Return type:

None

class betty.project.LocaleConfigurationMapping(configurations=None)[source]

Bases: ConfigurationMapping[str, LocaleConfiguration]

Parameters:
configurations=None

property default : LocaleConfiguration
property multilingual : bool
class betty.project.Project(*, project_id=None, ancestry=None)[source]

Bases: Configurable[ProjectConfiguration]

Parameters:
project_id=None

ancestry=None

property ancestry : Ancestry
property id : str
property name : str
final class betty.project.ProjectConfiguration(base_url=None, root_path='', clean_urls=False, title='Betty', author=None, entity_types=None, extensions=None, debug=False, locales=None, lifetime_threshold=125, name=None)[source]

Bases: FileBasedConfiguration

Parameters:
base_url=None

root_path=''

clean_urls=False

title='Betty'

author=None

entity_types=None

extensions=None

debug=False

locales=None

lifetime_threshold=125

name=None

property assets_directory_path : Path
property author : str | None
property base_url : str
property clean_urls : bool
property debug : bool
dump()[source]

Dump this instance to a portable format.

Return type:

dict[str, typing.Union[bool, int, float, str, None, typing.Sequence[typing.Union[bool, int, float, str, None, typing.Sequence[Dump], typing.Mapping[str, Dump]]], typing.Mapping[str, typing.Union[bool, int, float, str, None, typing.Sequence[Dump], typing.Mapping[str, Dump]]]]]

property entity_types : EntityTypeConfigurationMapping
property extensions : ExtensionConfigurationMapping
property lifetime_threshold : int
classmethod load(dump, configuration=None)[source]

Load dumped configuration into a new configuration instance.

Parameters:
dump

configuration=None

Return type:

typing.Self

property locales : LocaleConfigurationMapping
localize_www_directory_path(locale)[source]
Parameters:
locale

Return type:

pathlib.Path

property name : str | None
property output_directory_path : Path
property project_directory_path : Path
property root_path : str
property title : str
update(other)[source]
Parameters:
other

Return type:

None

property www_directory_path : Path