betty.project package¶
Subpackages¶
- betty.project.extension package
- Subpackages
- betty.project.extension.cotton_candy package
- Submodules
- betty.project.extension.cotton_candy.config module
CottonCandyConfiguration
CottonCandyConfiguration.DEFAULT_LINK_ACTIVE_COLOR
CottonCandyConfiguration.DEFAULT_LINK_INACTIVE_COLOR
CottonCandyConfiguration.DEFAULT_PRIMARY_ACTIVE_COLOR
CottonCandyConfiguration.DEFAULT_PRIMARY_INACTIVE_COLOR
CottonCandyConfiguration.__init__()
CottonCandyConfiguration.dump()
CottonCandyConfiguration.featured_entities
CottonCandyConfiguration.link_active_color
CottonCandyConfiguration.link_inactive_color
CottonCandyConfiguration.load()
CottonCandyConfiguration.primary_active_color
CottonCandyConfiguration.primary_inactive_color
- betty.project.extension.cotton_candy.config module
- Module contents
CottonCandy
CottonCandy.__init__()
CottonCandy.assets_directory_path()
CottonCandy.bootstrap()
CottonCandy.comes_after()
CottonCandy.depends_on()
CottonCandy.filters
CottonCandy.new_default_configuration()
CottonCandy.new_for_project()
CottonCandy.public_css_paths
CottonCandy.register_event_handlers()
CottonCandy.webpack_entry_point_cache_keys()
CottonCandy.webpack_entry_point_directory_path()
- Submodules
- betty.project.extension.demo package
- betty.project.extension.deriver package
- betty.project.extension.gramps package
- betty.project.extension.http_api_doc package
- betty.project.extension.maps package
- betty.project.extension.privatizer package
- betty.project.extension.trees package
- betty.project.extension.webpack package
- betty.project.extension.wikipedia package
- betty.project.extension.cotton_candy package
- Module contents
- Subpackages
- betty.project.generate package
Submodules¶
- betty.project.config module
CopyrightNoticeConfiguration
CopyrightNoticeConfigurationMapping
DEFAULT_LIFETIME_THRESHOLD
EntityTypeConfiguration
EntityTypeConfigurationMapping
EventTypeConfigurationMapping
ExtensionInstanceConfigurationMapping
GenderConfigurationMapping
LicenseConfiguration
LicenseConfigurationMapping
LocaleConfiguration
LocaleConfigurationMapping
PlaceTypeConfigurationMapping
PresenceRoleConfigurationMapping
ProjectConfiguration
ProjectConfiguration.__init__()
ProjectConfiguration.assets_directory_path
ProjectConfiguration.author
ProjectConfiguration.base_url
ProjectConfiguration.clean_urls
ProjectConfiguration.configuration_file_path
ProjectConfiguration.copyright_notice
ProjectConfiguration.copyright_notices
ProjectConfiguration.debug
ProjectConfiguration.dump()
ProjectConfiguration.entity_types
ProjectConfiguration.event_types
ProjectConfiguration.extensions
ProjectConfiguration.genders
ProjectConfiguration.license
ProjectConfiguration.licenses
ProjectConfiguration.lifetime_threshold
ProjectConfiguration.load()
ProjectConfiguration.locales
ProjectConfiguration.localize_www_directory_path()
ProjectConfiguration.logo
ProjectConfiguration.name
ProjectConfiguration.new()
ProjectConfiguration.output_directory_path
ProjectConfiguration.place_types
ProjectConfiguration.presence_roles
ProjectConfiguration.project_directory_path
ProjectConfiguration.root_path
ProjectConfiguration.title
ProjectConfiguration.url
ProjectConfiguration.www_directory_path
- betty.project.factory module
- betty.project.load module
- betty.project.url module
Module contents¶
Provide the project API.
Projects are how people use Betty. A project is a workspace, starting out with the user’s configuration, and combining it with the resulting ancestry, allowing the user to perform tasks, such as generating a site from the entire project.
- final class betty.project.Project[source]¶
Bases:
Configurable
[ProjectConfiguration
],TargetFactory
,CoreComponent
Define a Betty project.
A project combines project configuration and the resulting ancestry.
- __init__(app: App, configuration: ProjectConfiguration, *, ancestry: Ancestry)[source]¶
- property assets: Awaitable[AssetRepository]¶
The assets file system.
- property copyright_notice: Awaitable[CopyrightNotice]¶
The overall project copyright.
- property copyright_notice_repository: PluginRepository[CopyrightNotice]¶
The copyright notices available to this project.
Read more about Copyright notice plugins.
- property entity_type_repository: PluginRepository[Entity]¶
The entity types available to this project.
Read more about Entity type plugins.
- property event_dispatcher: EventDispatcher¶
The event dispatcher.
- property event_type_repository: PluginRepository[EventType]¶
The event types available to this project.
- property extension_repository: PluginRepository[Extension]¶
The extensions available to this project.
Read more about Extension plugins.
- property extensions: Awaitable[ProjectExtensions]¶
The enabled extensions.
- property gender_repository: PluginRepository[Gender]¶
The genders available to this project.
Read more about Gender plugins.
- property jinja2_environment: Awaitable[Environment]¶
The Jinja2 environment.
- property license_repository: Awaitable[PluginRepository[License]]¶
The licenses available to this project.
Read more about License plugins.
- property localized_url_generator: Awaitable[LocalizedUrlGenerator]¶
The URL generator for localizable resources.
- property localizers: Awaitable[LocalizerRepository]¶
The available localizers.
- property name: MachineName¶
The project name.
If no project name was configured, this defaults to the hash of the configuration file path.
- async classmethod new(app: App, *, configuration: ProjectConfiguration, ancestry: Ancestry | None = None) Self [source]¶
Create a new instance.
- async new_target(cls: type[_T]) _T [source]¶
Create a new instance.
- Returns:
- If
cls
extendsbetty.project.factory.ProjectDependentFactory
, this will call return cls
’snew()
’s return value.
- If
- If
cls
extendsbetty.app.factory.AppDependentFactory
, this will call returncls
’s new()
’s return value.
- If
- If
cls
extendsbetty.factory.IndependentFactory
, this will call returncls
’s new()
’s return value.
- If
Otherwise
cls()
will be called without arguments, and the resulting instance will be returned.
- Raises:
FactoryError – raised when
cls
could not be instantiated.
- classmethod new_temporary(app: App, *, configuration: ProjectConfiguration | None = None, ancestry: Ancestry | None = None) AsyncIterator[Self] [source]¶
Creat a new, temporary, isolated project.
The project will not leave any traces on the system, except when it uses global Betty functionality such as caches.
- property place_type_repository: PluginRepository[PlaceType]¶
The place types available to this project.
- property presence_role_repository: PluginRepository[PresenceRole]¶
The presence roles available to this project.
- property static_url_generator: Awaitable[StaticUrlGenerator]¶
The URL generator for static resources.
- class betty.project.ProjectEvent[source]¶
Bases:
Event
An event that is dispatched within the context of a
betty.project.Project
.- __init__(job_context: ProjectContext)[source]¶
- property job_context: ProjectContext¶
The site generation job context.
- property project: Project¶
The
betty.project.Project
this event is dispatched within.
- final class betty.project.ProjectExtensions[source]¶
Bases:
object
Manage the extensions running within the
betty.project.Project
.This is internal. It MAY be used anywhere in Betty’s source code, but MUST NOT be used by third-party code.
- final class betty.project.ProjectSchema[source]¶
Bases:
ProjectDependentFactory
,Schema
A JSON Schema for a project.
- async classmethod def_url(project: Project, def_name: str) str [source]¶
Get the URL to a project’s JSON Schema definition.