API reference
.. py:module:: archledger.repository
.. py:class:: InitResult(workspace_root: ‘Path’, config_path: ‘Path’, archledger_dir: ‘Path’, created_paths: ‘tuple[Path, …]’) :module: archledger.repository
.. py:attribute:: InitResult.workspace_root :module: archledger.repository :type: ~pathlib.Path
.. py:attribute:: InitResult.config_path :module: archledger.repository :type: ~pathlib.Path
.. py:attribute:: InitResult.archledger_dir :module: archledger.repository :type: ~pathlib.Path
.. py:attribute:: InitResult.created_paths :module: archledger.repository :type: tuple[~pathlib.Path, …]
.. py:method:: InitResult.init(workspace_root: ~pathlib.Path, config_path: ~pathlib.Path, archledger_dir: ~pathlib.Path, created_paths: tuple[~pathlib.Path, …]) -> None :module: archledger.repository
.. py:class:: StatusResult(workspace_root: ‘Path’, config_path: ‘Path’, archledger_dir: ‘Path’, archive_dir: ‘Path’, sections_count: ‘int’, record_directories_count: ‘int’, storage_meta_path: ‘Path’, build_dir: ‘Path’) :module: archledger.repository
.. py:attribute:: StatusResult.workspace_root :module: archledger.repository :type: ~pathlib.Path
.. py:attribute:: StatusResult.config_path :module: archledger.repository :type: ~pathlib.Path
.. py:attribute:: StatusResult.archledger_dir :module: archledger.repository :type: ~pathlib.Path
.. py:attribute:: StatusResult.archive_dir :module: archledger.repository :type: ~pathlib.Path
.. py:attribute:: StatusResult.sections_count :module: archledger.repository :type: int
.. py:attribute:: StatusResult.record_directories_count :module: archledger.repository :type: int
.. py:attribute:: StatusResult.storage_meta_path :module: archledger.repository :type: ~pathlib.Path
.. py:attribute:: StatusResult.build_dir :module: archledger.repository :type: ~pathlib.Path
.. py:method:: StatusResult.init(workspace_root: ~pathlib.Path, config_path: ~pathlib.Path, archledger_dir: ~pathlib.Path, archive_dir: ~pathlib.Path, sections_count: int, record_directories_count: int, storage_meta_path: ~pathlib.Path, build_dir: ~pathlib.Path) -> None :module: archledger.repository
.. py:class:: CheckFinding(level: ‘str’, message: ‘str’, path: ‘Path | None’ = None) :module: archledger.repository
.. py:attribute:: CheckFinding.level :module: archledger.repository :type: str
.. py:attribute:: CheckFinding.message :module: archledger.repository :type: str
.. py:attribute:: CheckFinding.path :module: archledger.repository :type: ~pathlib.Path | None
.. py:method:: CheckFinding.init(level: str, message: str, path: ~pathlib.Path | None = None) -> None :module: archledger.repository
.. py:class:: CheckResult(errors: ‘tuple[CheckFinding, …]’, warnings: ‘tuple[CheckFinding, …]’) :module: archledger.repository
.. py:attribute:: CheckResult.errors :module: archledger.repository :type: tuple[~archledger.repository.CheckFinding, …]
.. py:attribute:: CheckResult.warnings :module: archledger.repository :type: tuple[~archledger.repository.CheckFinding, …]
.. py:method:: CheckResult.has_failures(*, strict: bool) -> bool :module: archledger.repository
.. py:method:: CheckResult.init(errors: tuple[~archledger.repository.CheckFinding, …], warnings: tuple[~archledger.repository.CheckFinding, …]) -> None :module: archledger.repository
.. py:class:: ArchiveResult(record_id: ‘str’, source_path: ‘Path’, archive_path: ‘Path’, reason: ‘str’, already_archived: ‘bool’ = False) :module: archledger.repository
.. py:attribute:: ArchiveResult.record_id :module: archledger.repository :type: str
.. py:attribute:: ArchiveResult.source_path :module: archledger.repository :type: ~pathlib.Path
.. py:attribute:: ArchiveResult.archive_path :module: archledger.repository :type: ~pathlib.Path
.. py:attribute:: ArchiveResult.reason :module: archledger.repository :type: str
.. py:attribute:: ArchiveResult.already_archived :module: archledger.repository :type: bool
.. py:method:: ArchiveResult.init(record_id: str, source_path: ~pathlib.Path, archive_path: ~pathlib.Path, reason: str, already_archived: bool = False) -> None :module: archledger.repository
.. py:class:: DoctorRepair(kind: ‘str’, message: ‘str’, path: ‘Path | None’ = None, before: ‘int | None’ = None, after: ‘int | None’ = None) :module: archledger.repository
.. py:attribute:: DoctorRepair.kind :module: archledger.repository :type: str
.. py:attribute:: DoctorRepair.message :module: archledger.repository :type: str
.. py:attribute:: DoctorRepair.path :module: archledger.repository :type: ~pathlib.Path | None
.. py:attribute:: DoctorRepair.before :module: archledger.repository :type: int | None
.. py:attribute:: DoctorRepair.after :module: archledger.repository :type: int | None
.. py:method:: DoctorRepair.init(kind: str, message: str, path: ~pathlib.Path | None = None, before: int | None = None, after: int | None = None) -> None :module: archledger.repository
.. py:class:: DoctorResult(errors: ‘tuple[CheckFinding, …]’, warnings: ‘tuple[CheckFinding, …]’, repairs: ‘tuple[DoctorRepair, …]’, storage_next_number_before: ‘int’, storage_next_number_after: ‘int’, highest_seen: ‘int’, missing_numbers: ‘tuple[int, …]’, duplicate_numbers: ‘tuple[int, …]’) :module: archledger.repository
.. py:attribute:: DoctorResult.errors :module: archledger.repository :type: tuple[~archledger.repository.CheckFinding, …]
.. py:attribute:: DoctorResult.warnings :module: archledger.repository :type: tuple[~archledger.repository.CheckFinding, …]
.. py:attribute:: DoctorResult.repairs :module: archledger.repository :type: tuple[~archledger.repository.DoctorRepair, …]
.. py:attribute:: DoctorResult.storage_next_number_before :module: archledger.repository :type: int
.. py:attribute:: DoctorResult.storage_next_number_after :module: archledger.repository :type: int
.. py:attribute:: DoctorResult.highest_seen :module: archledger.repository :type: int
.. py:attribute:: DoctorResult.missing_numbers :module: archledger.repository :type: tuple[int, …]
.. py:attribute:: DoctorResult.duplicate_numbers :module: archledger.repository :type: tuple[int, …]
.. py:method:: DoctorResult.init(errors: tuple[~archledger.repository.CheckFinding, …], warnings: tuple[~archledger.repository.CheckFinding, …], repairs: tuple[~archledger.repository.DoctorRepair, …], storage_next_number_before: int, storage_next_number_after: int, highest_seen: int, missing_numbers: tuple[int, …], duplicate_numbers: tuple[int, …]) -> None :module: archledger.repository
.. py:class:: ArchitectureRepository(paths: ~archledger.storage.paths.ProjectPaths, config: ~archledger.config.model.ProjectConfig) :module: archledger.repository
.. py:method:: ArchitectureRepository.init(paths: ~archledger.storage.paths.ProjectPaths, config: ~archledger.config.model.ProjectConfig) -> None :module: archledger.repository
.. py:method:: ArchitectureRepository.init(*, overwrite: bool = False) -> ~archledger.repository.InitResult :module: archledger.repository
.. py:method:: ArchitectureRepository.status() -> ~archledger.repository.StatusResult :module: archledger.repository
.. py:method:: ArchitectureRepository.create_record(kind: str, title: str, **kwargs: object) -> ~archledger.model.ArchitectureRecord :module: archledger.repository
.. py:method:: ArchitectureRepository.list_records(*, include_draft: bool = False, include_superseded: bool = False, kind: str | None = None, scope: str | None = None, scope_kind: str | None = None, addon: str | None = None) -> list[~archledger.model.ArchitectureRecord] :module: archledger.repository
.. py:method:: ArchitectureRepository.load_all_records(*, include_sections: bool = True) -> list[~archledger.model.ArchitectureRecord] :module: archledger.repository
.. py:method:: ArchitectureRepository.get_record(record_id: str) -> ~archledger.model.ArchitectureRecord :module: archledger.repository
.. py:method:: ArchitectureRepository.check(*, strict: bool = False) -> ~archledger.repository.CheckResult :module: archledger.repository
.. py:method:: ArchitectureRepository.archive_record(record_id: str, *, reason: str = ‘’) -> ~archledger.repository.ArchiveResult :module: archledger.repository
.. py:method:: ArchitectureRepository.doctor(*, repair: bool = False) -> ~archledger.repository.DoctorResult :module: archledger.repository
.. py:function:: path_in_archive(path: ~pathlib.Path, archive_dir: ~pathlib.Path) -> bool :module: archledger.repository
.. py:module:: archledger.model
.. py:function:: known_source_extensions(config: object) -> tuple[str, …] :module: archledger.model
Return sorted tuple of all recognised source file extensions.
.. py:class:: SectionSpec(key: ‘str’, title: ‘str’, order: ‘int’, number: ‘int’) :module: archledger.model
.. py:attribute:: SectionSpec.key :module: archledger.model :type: str
.. py:attribute:: SectionSpec.title :module: archledger.model :type: str
.. py:attribute:: SectionSpec.order :module: archledger.model :type: int
.. py:attribute:: SectionSpec.number :module: archledger.model :type: int
.. py:method:: SectionSpec.init(key: str, title: str, order: int, number: int) -> None :module: archledger.model
.. py:class:: SourceRef(path: ‘str’, symbols: ‘tuple[str, …]’, reason: ‘str’ = ‘’, role: ‘str’ = ‘’) :module: archledger.model
.. py:attribute:: SourceRef.path :module: archledger.model :type: str
.. py:attribute:: SourceRef.symbols :module: archledger.model :type: tuple[str, …]
.. py:attribute:: SourceRef.reason :module: archledger.model :type: str
.. py:attribute:: SourceRef.role :module: archledger.model :type: str
.. py:method:: SourceRef.init(path: str, symbols: tuple[str, …], reason: str = ‘’, role: str = ‘’) -> None :module: archledger.model
.. py:class:: ArchitectureRecord(id: ‘str’, kind: ‘str’, type: ‘str’, title: ‘str’, status: ‘str’, section: ‘str’, order: ‘int’, path: ‘Path’, metadata: ‘dict[str, object]’, body: ‘str’, source_refs: ‘tuple[SourceRef, …]’ = (), links: ‘tuple’ = (), test_refs: ‘tuple’ = (), scope: ‘RecordScope | None’ = None) :module: archledger.model
.. py:attribute:: ArchitectureRecord.id :module: archledger.model :type: str
.. py:attribute:: ArchitectureRecord.kind :module: archledger.model :type: str
.. py:attribute:: ArchitectureRecord.type :module: archledger.model :type: str
.. py:attribute:: ArchitectureRecord.title :module: archledger.model :type: str
.. py:attribute:: ArchitectureRecord.status :module: archledger.model :type: str
.. py:attribute:: ArchitectureRecord.section :module: archledger.model :type: str
.. py:attribute:: ArchitectureRecord.order :module: archledger.model :type: int
.. py:attribute:: ArchitectureRecord.path :module: archledger.model :type: Path
.. py:attribute:: ArchitectureRecord.metadata :module: archledger.model :type: dict[str, object]
.. py:attribute:: ArchitectureRecord.body :module: archledger.model :type: str
.. py:attribute:: ArchitectureRecord.source_refs :module: archledger.model :type: tuple[SourceRef, …]
.. py:attribute:: ArchitectureRecord.links :module: archledger.model :type: tuple
.. py:attribute:: ArchitectureRecord.test_refs :module: archledger.model :type: tuple
.. py:attribute:: ArchitectureRecord.scope :module: archledger.model :type: RecordScope | None
.. py:method:: ArchitectureRecord.init(id: str, kind: str, type: str, title: str, status: str, section: str, order: int, path: Path, metadata: dict[str, object], body: str, source_refs: tuple[SourceRef, …] = (), links: tuple = (), test_refs: tuple = (), scope: RecordScope | None = None) -> None :module: archledger.model
.. py:function:: normalize_kind(kind: str) -> str :module: archledger.model
.. py:function:: validate_record(record: ~archledger.model.ArchitectureRecord, *, id_format: ~archledger.ids.LedgerIdFormat | None = None, expected_segment: str | None = None, id_prefix: str = ‘al’, id_width: int = 4) -> list[str] :module: archledger.model
.. py:function:: validate_record_metadata_shape(record: ~archledger.model.ArchitectureRecord) -> list[str] :module: archledger.model
.. py:class:: SourceFormatSpec(extension: str, native_output: str, section_body_placeholder: str, empty_section_placeholder: str) :module: archledger.model
All per-format attributes for a source format.
.. py:attribute:: SourceFormatSpec.extension :module: archledger.model :type: str
.. py:attribute:: SourceFormatSpec.native_output :module: archledger.model :type: str
.. py:attribute:: SourceFormatSpec.section_body_placeholder :module: archledger.model :type: str
.. py:attribute:: SourceFormatSpec.empty_section_placeholder :module: archledger.model :type: str
.. py:method:: SourceFormatSpec.init(extension: str, native_output: str, section_body_placeholder: str, empty_section_placeholder: str) -> None :module: archledger.model
.. py:function:: source_format_spec(source_format: str) -> ~archledger.model.SourceFormatSpec :module: archledger.model
Return the full spec for a source format.
.. py:function:: default_extension_for_source_format(source_format: str) -> str :module: archledger.model
.. py:function:: native_output_format_for_source_format(source_format: str) -> str :module: archledger.model
.. py:function:: infer_output_format_from_path(path: str | ~pathlib.Path) -> str | None :module: archledger.model
.. py:function:: default_document_filename_for_output_format(output_format: str) -> str :module: archledger.model
.. py:function:: document_template_name_for_source_format(source_format: str) -> str :module: archledger.model
.. py:function:: record_template_name_for_source_format(kind: str, source_format: str = ‘markdown’) -> str :module: archledger.model
.. py:function:: section_body_placeholder_for_source_format(source_format: str) -> str :module: archledger.model
.. py:function:: empty_section_placeholder_for_source_format(source_format: str) -> str :module: archledger.model
.. py:function:: section_filename_for(section_spec: ~archledger.model.SectionSpec, extension: str = ‘.md’, *, id_prefix: str = ‘al’, id_width: int = 4, segment_mode: str = ‘none’, segment: str | None = None) -> str :module: archledger.model
.. py:function:: filename_for(number: int, extension: str = ‘.md’, *, id_prefix: str = ‘al’, id_width: int = 4, segment_mode: str = ‘none’, segment: str | None = None) -> str :module: archledger.model
.. py:function:: id_from_filename(path: ~pathlib.Path) -> str :module: archledger.model
.. py:function:: is_visible_status(status: str, *, include_draft: bool, include_superseded: bool, include_archived: bool = False) -> bool :module: archledger.model
.. py:function:: record_sort_key(record: ~archledger.model.ArchitectureRecord) -> tuple[int, int, str, int, str] :module: archledger.model
.. py:module:: archledger.source_tracking
.. py:class:: TrackedFile(path: ‘str’, sha256: ‘str’) :module: archledger.source_tracking
.. py:attribute:: TrackedFile.path :module: archledger.source_tracking :type: str
.. py:attribute:: TrackedFile.sha256 :module: archledger.source_tracking :type: str
.. py:method:: TrackedFile.init(path: str, sha256: str) -> None :module: archledger.source_tracking
.. py:class:: DirectoryState(path: ‘str’, sha256: ‘str’, file_count: ‘int’) :module: archledger.source_tracking
.. py:attribute:: DirectoryState.path :module: archledger.source_tracking :type: str
.. py:attribute:: DirectoryState.sha256 :module: archledger.source_tracking :type: str
.. py:attribute:: DirectoryState.file_count :module: archledger.source_tracking :type: int
.. py:method:: DirectoryState.init(path: str, sha256: str, file_count: int) -> None :module: archledger.source_tracking
.. py:class:: SourceState(schema: ‘str’, project_uuid: ‘str’, project_name: ‘str’, version: ‘int’, reason: ‘str’, scanner: ‘dict[str, object]’, files: ‘dict[str, TrackedFile]’, directories: ‘dict[str, DirectoryState]’) :module: archledger.source_tracking
.. py:attribute:: SourceState.schema :module: archledger.source_tracking :type: str
.. py:attribute:: SourceState.project_uuid :module: archledger.source_tracking :type: str
.. py:attribute:: SourceState.project_name :module: archledger.source_tracking :type: str
.. py:attribute:: SourceState.version :module: archledger.source_tracking :type: int
.. py:attribute:: SourceState.reason :module: archledger.source_tracking :type: str
.. py:attribute:: SourceState.scanner :module: archledger.source_tracking :type: dict[str, object]
.. py:attribute:: SourceState.files :module: archledger.source_tracking :type: dict[str, ~archledger.source_tracking.TrackedFile]
.. py:attribute:: SourceState.directories :module: archledger.source_tracking :type: dict[str, ~archledger.source_tracking.DirectoryState]
.. py:method:: SourceState.init(schema: str, project_uuid: str, project_name: str, version: int, reason: str, scanner: dict[str, object], files: dict[str, ~archledger.source_tracking.TrackedFile], directories: dict[str, ~archledger.source_tracking.DirectoryState]) -> None :module: archledger.source_tracking
.. py:class:: ChangedFile(path: ‘str’, change: ‘str’, old_sha256: ‘str | None’ = None, new_sha256: ‘str | None’ = None) :module: archledger.source_tracking
.. py:attribute:: ChangedFile.path :module: archledger.source_tracking :type: str
.. py:attribute:: ChangedFile.change :module: archledger.source_tracking :type: str
.. py:attribute:: ChangedFile.old_sha256 :module: archledger.source_tracking :type: str | None
.. py:attribute:: ChangedFile.new_sha256 :module: archledger.source_tracking :type: str | None
.. py:method:: ChangedFile.init(path: str, change: str, old_sha256: str | None = None, new_sha256: str | None = None) -> None :module: archledger.source_tracking
.. py:class:: PossibleRename(old_path: ‘str’, new_path: ‘str’, sha256: ‘str’) :module: archledger.source_tracking
.. py:attribute:: PossibleRename.old_path :module: archledger.source_tracking :type: str
.. py:attribute:: PossibleRename.new_path :module: archledger.source_tracking :type: str
.. py:attribute:: PossibleRename.sha256 :module: archledger.source_tracking :type: str
.. py:method:: PossibleRename.init(old_path: str, new_path: str, sha256: str) -> None :module: archledger.source_tracking
.. py:class:: ImpactedRecord(id: ‘str’, type: ‘str’, title: ‘str’, status: ‘str’, section: ‘str’, path: ‘str’, matched_refs: ‘tuple[str, …]’) :module: archledger.source_tracking
.. py:attribute:: ImpactedRecord.id :module: archledger.source_tracking :type: str
.. py:attribute:: ImpactedRecord.type :module: archledger.source_tracking :type: str
.. py:attribute:: ImpactedRecord.title :module: archledger.source_tracking :type: str
.. py:attribute:: ImpactedRecord.status :module: archledger.source_tracking :type: str
.. py:attribute:: ImpactedRecord.section :module: archledger.source_tracking :type: str
.. py:attribute:: ImpactedRecord.path :module: archledger.source_tracking :type: str
.. py:attribute:: ImpactedRecord.matched_refs :module: archledger.source_tracking :type: tuple[str, …]
.. py:method:: ImpactedRecord.init(id: str, type: str, title: str, status: str, section: str, path: str, matched_refs: tuple[str, …]) -> None :module: archledger.source_tracking
.. py:class:: ChangeSet(baseline_exists: ‘bool’, baseline_version: ‘int | None’, baseline_reason: ‘str | None’, current_version: ‘int’, scanner_used: ‘str’, file_count: ‘int’, changed_files: ‘tuple[ChangedFile, …]’, possible_renames: ‘tuple[PossibleRename, …]’, impacted_records: ‘tuple[ImpactedRecord, …]’, impacted_sections: ‘tuple[str, …]’, unlinked_changed_files: ‘tuple[str, …]’, unbaselined_files: ‘tuple[str, …]’ = ()) :module: archledger.source_tracking
.. py:attribute:: ChangeSet.baseline_exists :module: archledger.source_tracking :type: bool
.. py:attribute:: ChangeSet.baseline_version :module: archledger.source_tracking :type: int | None
.. py:attribute:: ChangeSet.baseline_reason :module: archledger.source_tracking :type: str | None
.. py:attribute:: ChangeSet.current_version :module: archledger.source_tracking :type: int
.. py:attribute:: ChangeSet.scanner_used :module: archledger.source_tracking :type: str
.. py:attribute:: ChangeSet.file_count :module: archledger.source_tracking :type: int
.. py:attribute:: ChangeSet.changed_files :module: archledger.source_tracking :type: tuple[~archledger.source_tracking.ChangedFile, …]
.. py:attribute:: ChangeSet.possible_renames :module: archledger.source_tracking :type: tuple[~archledger.source_tracking.PossibleRename, …]
.. py:attribute:: ChangeSet.impacted_records :module: archledger.source_tracking :type: tuple[~archledger.source_tracking.ImpactedRecord, …]
.. py:attribute:: ChangeSet.impacted_sections :module: archledger.source_tracking :type: tuple[str, …]
.. py:attribute:: ChangeSet.unlinked_changed_files :module: archledger.source_tracking :type: tuple[str, …]
.. py:attribute:: ChangeSet.unbaselined_files :module: archledger.source_tracking :type: tuple[str, …]
.. py:method:: ChangeSet.init(baseline_exists: bool, baseline_version: int | None, baseline_reason: str | None, current_version: int, scanner_used: str, file_count: int, changed_files: tuple[~archledger.source_tracking.ChangedFile, …], possible_renames: tuple[~archledger.source_tracking.PossibleRename, …], impacted_records: tuple[~archledger.source_tracking.ImpactedRecord, …], impacted_sections: tuple[str, …], unlinked_changed_files: tuple[str, …], unbaselined_files: tuple[str, …] = ()) -> None :module: archledger.source_tracking
.. py:function:: scan_workspace(paths: ~archledger.storage.paths.ProjectPaths, config: ~archledger.config.model.ProjectConfig, *, reason: str = ‘manual’, version: int = 1) -> ~archledger.source_tracking.SourceState :module: archledger.source_tracking
.. py:function:: diff_source_states(baseline: ~archledger.source_tracking.SourceState | None, current: ~archledger.source_tracking.SourceState) -> ~archledger.source_tracking.ChangeSet :module: archledger.source_tracking
.. py:function:: resolve_impacts(records: list[~archledger.model.ArchitectureRecord], changes: ~archledger.source_tracking.ChangeSet, *, include_draft: bool, include_superseded: bool) -> ~archledger.source_tracking.ChangeSet :module: archledger.source_tracking
.. py:function:: scan_git_revision(paths: ~archledger.storage.paths.ProjectPaths, config: ~archledger.config.model.ProjectConfig, revision: str, *, reason: str, version: int = 0) -> ~archledger.source_tracking.SourceState :module: archledger.source_tracking
Build a SourceState from a git revision using ls-tree and show.
.. py:function:: scan_since_merge_base(paths: ~archledger.storage.paths.ProjectPaths, config: ~archledger.config.model.ProjectConfig, revision: str, *, reason: str = ‘merge-base’) -> tuple[~archledger.source_tracking.SourceState, ~archledger.source_tracking.SourceState] :module: archledger.source_tracking
Return (base_state, current_state) for merge-base comparison.
.. py:module:: archledger.storage.project_config
.. py:class:: Arc42Config(template_version: ‘str’, language: ‘str’, title: ‘str’, include_help: ‘bool’) :module: archledger.storage.project_config :canonical: archledger.config.model.Arc42Config
.. py:attribute:: Arc42Config.template_version :module: archledger.storage.project_config :type: str
.. py:attribute:: Arc42Config.language :module: archledger.storage.project_config :type: str
.. py:attribute:: Arc42Config.title :module: archledger.storage.project_config :type: str
.. py:attribute:: Arc42Config.include_help :module: archledger.storage.project_config :type: bool
.. py:method:: Arc42Config.init(template_version: str, language: str, title: str, include_help: bool) -> None :module: archledger.storage.project_config
.. py:class:: Arc42ProfileConfig(kind: str = ‘documentation’, template: str = ‘arc42’, sections_dir: str = ‘profiles/arc42/sections’, build_template: str = ‘arc42_document’, include_help: bool = False) :module: archledger.storage.project_config :canonical: archledger.config.model.Arc42ProfileConfig
arc42 documentation profile settings.
.. py:attribute:: Arc42ProfileConfig.kind :module: archledger.storage.project_config :type: str
.. py:attribute:: Arc42ProfileConfig.template :module: archledger.storage.project_config :type: str
.. py:attribute:: Arc42ProfileConfig.sections_dir :module: archledger.storage.project_config :type: str
.. py:attribute:: Arc42ProfileConfig.build_template :module: archledger.storage.project_config :type: str
.. py:attribute:: Arc42ProfileConfig.include_help :module: archledger.storage.project_config :type: bool
.. py:method:: Arc42ProfileConfig.init(kind: str = ‘documentation’, template: str = ‘arc42’, sections_dir: str = ‘profiles/arc42/sections’, build_template: str = ‘arc42_document’, include_help: bool = False) -> None :module: archledger.storage.project_config
.. py:class:: BuildConfig(default_output: ‘str’, default_format: ‘str’, default_output_dir: ‘str’, include_draft: ‘bool’, include_superseded: ‘bool’, strict: ‘bool’, keep_intermediate: ‘bool’, converter: ‘str’, pdf_engine: ‘str’, reference_docx: ‘str’, outputs: ‘dict[str, BuildOutputConfig]’) :module: archledger.storage.project_config :canonical: archledger.config.model.BuildConfig
.. py:attribute:: BuildConfig.default_output :module: archledger.storage.project_config :type: str
.. py:attribute:: BuildConfig.default_format :module: archledger.storage.project_config :type: str
.. py:attribute:: BuildConfig.default_output_dir :module: archledger.storage.project_config :type: str
.. py:attribute:: BuildConfig.include_draft :module: archledger.storage.project_config :type: bool
.. py:attribute:: BuildConfig.include_superseded :module: archledger.storage.project_config :type: bool
.. py:attribute:: BuildConfig.strict :module: archledger.storage.project_config :type: bool
.. py:attribute:: BuildConfig.keep_intermediate :module: archledger.storage.project_config :type: bool
.. py:attribute:: BuildConfig.converter :module: archledger.storage.project_config :type: str
.. py:attribute:: BuildConfig.pdf_engine :module: archledger.storage.project_config :type: str
.. py:attribute:: BuildConfig.reference_docx :module: archledger.storage.project_config :type: str
.. py:attribute:: BuildConfig.outputs :module: archledger.storage.project_config :type: dict[str, ~archledger.config.model.BuildOutputConfig]
.. py:method:: BuildConfig.init(default_output: str, default_format: str, default_output_dir: str, include_draft: bool, include_superseded: bool, strict: bool, keep_intermediate: bool, converter: str, pdf_engine: str, reference_docx: str, outputs: dict[str, ~archledger.config.model.BuildOutputConfig]) -> None :module: archledger.storage.project_config
.. py:class:: BuildOutputConfig(enabled: ‘bool | None’ = None, tool: ‘str | None’ = None, pdf_engine: ‘str’ = ‘’, reference_docx: ‘str’ = ‘’) :module: archledger.storage.project_config :canonical: archledger.config.model.BuildOutputConfig
.. py:attribute:: BuildOutputConfig.enabled :module: archledger.storage.project_config :type: bool | None
.. py:attribute:: BuildOutputConfig.tool :module: archledger.storage.project_config :type: str | None
.. py:attribute:: BuildOutputConfig.pdf_engine :module: archledger.storage.project_config :type: str
.. py:attribute:: BuildOutputConfig.reference_docx :module: archledger.storage.project_config :type: str
.. py:method:: BuildOutputConfig.init(enabled: bool | None = None, tool: str | None = None, pdf_engine: str = ‘’, reference_docx: str = ‘’) -> None :module: archledger.storage.project_config
.. py:class:: DiagramConfig(enabled: ‘bool’, renderer: ‘str’, default_type: ‘str’, output_dir: ‘str’, image_format: ‘str’, kroki_url: ‘str’) :module: archledger.storage.project_config :canonical: archledger.config.model.DiagramConfig
.. py:attribute:: DiagramConfig.enabled :module: archledger.storage.project_config :type: bool
.. py:attribute:: DiagramConfig.renderer :module: archledger.storage.project_config :type: str
.. py:attribute:: DiagramConfig.default_type :module: archledger.storage.project_config :type: str
.. py:attribute:: DiagramConfig.output_dir :module: archledger.storage.project_config :type: str
.. py:attribute:: DiagramConfig.image_format :module: archledger.storage.project_config :type: str
.. py:attribute:: DiagramConfig.kroki_url :module: archledger.storage.project_config :type: str
.. py:method:: DiagramConfig.init(enabled: bool, renderer: str, default_type: str, output_dir: str, image_format: str, kroki_url: str) -> None :module: archledger.storage.project_config
.. py:class:: ProfilesConfig(enabled: tuple[str, …] = (‘arc42’,), default: str = ‘arc42’) :module: archledger.storage.project_config :canonical: archledger.config.model.ProfilesConfig
Top-level profile selection: which profiles are enabled.
.. py:attribute:: ProfilesConfig.enabled :module: archledger.storage.project_config :type: tuple[str, …]
.. py:attribute:: ProfilesConfig.default :module: archledger.storage.project_config :type: str
.. py:method:: ProfilesConfig.init(enabled: tuple[str, …] = (‘arc42’,), default: str = ‘arc42’) -> None :module: archledger.storage.project_config
.. py:class:: ProjectConfig(config_version: int, archledger_dir: str = ‘’, project_uuid: str = ‘’, project_name: str = ‘’, ledger_code: str = ‘al’, id_width: int = 4, id_default_kind: str = ‘content’, id_kind_map: dict[str, str] = Archledger tool configuration (currently version 11, migrating to 12). Runtime identity fields (archledger_dir, project_uuid, project_name) are
removed from serialized config in version 12 and supplied by the project
context at runtime. They default to empty strings for backward compat. .. py:attribute:: ProjectConfig.config_version
:module: archledger.storage.project_config
:type: int .. py:attribute:: ProjectConfig.archledger_dir
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.project_uuid
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.project_name
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.ledger_code
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.id_width
:module: archledger.storage.project_config
:type: int .. py:attribute:: ProjectConfig.id_default_kind
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.id_kind_map
:module: archledger.storage.project_config
:type: dict[str, str] .. py:attribute:: ProjectConfig.id_prefix
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.id_segment_mode
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.id_default_segment
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.id_segment_map
:module: archledger.storage.project_config
:type: dict[str, str] .. py:attribute:: ProjectConfig.source_format
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.source_schema_version
:module: archledger.storage.project_config
:type: int .. py:attribute:: ProjectConfig.front_matter
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.section_extension
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.record_extension
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.build_default_output
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.build_default_format
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.build_output_dir
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.build_include_draft
:module: archledger.storage.project_config
:type: bool .. py:attribute:: ProjectConfig.build_include_superseded
:module: archledger.storage.project_config
:type: bool .. py:attribute:: ProjectConfig.build_strict
:module: archledger.storage.project_config
:type: bool .. py:attribute:: ProjectConfig.build_keep_intermediate
:module: archledger.storage.project_config
:type: bool .. py:attribute:: ProjectConfig.build_converter
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.build_pdf_engine
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.build_reference_docx
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.build_outputs
:module: archledger.storage.project_config
:type: dict[str, dict[str, object]] .. py:attribute:: ProjectConfig.arc42_template_version
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.arc42_language
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.arc42_title
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.arc42_include_help
:module: archledger.storage.project_config
:type: bool .. py:attribute:: ProjectConfig.skill_installed
:module: archledger.storage.project_config
:type: bool .. py:attribute:: ProjectConfig.skill_path
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.tracking_enabled
:module: archledger.storage.project_config
:type: bool .. py:attribute:: ProjectConfig.tracking_state_file
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.tracking_scanner
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.tracking_include
:module: archledger.storage.project_config
:type: tuple[str, …] .. py:attribute:: ProjectConfig.tracking_exclude
:module: archledger.storage.project_config
:type: tuple[str, …] .. py:attribute:: ProjectConfig.tracking_max_file_bytes
:module: archledger.storage.project_config
:type: int .. py:attribute:: ProjectConfig.tracking_hash_algorithm
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.diagram_enabled
:module: archledger.storage.project_config
:type: bool .. py:attribute:: ProjectConfig.diagram_renderer
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.diagram_default_type
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.diagram_output_dir
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.diagram_image_format
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.diagram_kroki_url
:module: archledger.storage.project_config
:type: str .. py:attribute:: ProjectConfig.profiles
:module: archledger.storage.project_config
:type: ~archledger.config.model.ProjectProfilesConfig .. py:attribute:: ProjectConfig.profiles_present
:module: archledger.storage.project_config
:type: bool .. py:attribute:: ProjectConfig.legacy_sections_warned
:module: archledger.storage.project_config
:type: bool .. py:property:: ProjectConfig.ledger_name
:module: archledger.storage.project_config
:type: str .. py:property:: ProjectConfig.profile
:module: archledger.storage.project_config
:type: str .. py:property:: ProjectConfig.ledger
:module: archledger.storage.project_config
:type: ~archledger.config.model.LedgerConfig .. py:property:: ProjectConfig.source
:module: archledger.storage.project_config
:type: ~archledger.config.model.SourceConfig .. py:property:: ProjectConfig.build
:module: archledger.storage.project_config
:type: ~archledger.config.model.BuildConfig .. py:property:: ProjectConfig.arc42
:module: archledger.storage.project_config
:type: ~archledger.config.model.Arc42Config .. py:property:: ProjectConfig.skill
:module: archledger.storage.project_config
:type: ~archledger.config.model.SkillConfig .. py:property:: ProjectConfig.ids
:module: archledger.storage.project_config
:type: ~archledger.config.model.IdConfig .. py:property:: ProjectConfig.id_format
:module: archledger.storage.project_config
:type: ~archledger.ids.LedgerIdFormat .. py:property:: ProjectConfig.tracking
:module: archledger.storage.project_config
:type: ~archledger.config.model.TrackingConfig .. py:property:: ProjectConfig.diagrams
:module: archledger.storage.project_config
:type: ~archledger.config.model.DiagramConfig .. py:method:: ProjectConfig.profiles_config() -> ~archledger.config.model.ProjectProfilesConfig
:module: archledger.storage.project_config .. py:method:: ProjectConfig.init(config_version: int, archledger_dir: str = ‘’, project_uuid: str = ‘’, project_name: str = ‘’, ledger_code: str = ‘al’, id_width: int = 4, id_default_kind: str = ‘content’, id_kind_map: dict[str, str] = .. py:class:: ProjectProfilesConfig(profiles: ~archledger.config.model.ProfilesConfig = ProfilesConfig(enabled=(‘arc42’,), default=’arc42’), arc42: ~archledger.config.model.Arc42ProfileConfig = Arc42ProfileConfig(kind=’documentation’, template=’arc42’, sections_dir=’profiles/arc42/sections’, build_template=’arc42_document’, include_help=False))
:module: archledger.storage.project_config
:canonical: archledger.config.model.ProjectProfilesConfig Aggregated profile configuration for a project. .. py:attribute:: ProjectProfilesConfig.profiles
:module: archledger.storage.project_config
:type: ~archledger.config.model.ProfilesConfig .. py:attribute:: ProjectProfilesConfig.arc42
:module: archledger.storage.project_config
:type: ~archledger.config.model.Arc42ProfileConfig .. py:method:: ProjectProfilesConfig.init(profiles: ~archledger.config.model.ProfilesConfig = ProfilesConfig(enabled=(‘arc42’,), default=’arc42’), arc42: ~archledger.config.model.Arc42ProfileConfig = Arc42ProfileConfig(kind=’documentation’, template=’arc42’, sections_dir=’profiles/arc42/sections’, build_template=’arc42_document’, include_help=False)) -> None
:module: archledger.storage.project_config .. py:class:: IdConfig(prefix: ‘str’, width: ‘int’, segment_mode: ‘str’, default_segment: ‘str’, segment_map: ‘dict[str, str]’, default_kind: ‘str’, kind_map: ‘dict[str, str]’)
:module: archledger.storage.project_config
:canonical: archledger.config.model.IdConfig .. py:attribute:: IdConfig.prefix
:module: archledger.storage.project_config
:type: str .. py:attribute:: IdConfig.width
:module: archledger.storage.project_config
:type: int .. py:attribute:: IdConfig.segment_mode
:module: archledger.storage.project_config
:type: str .. py:attribute:: IdConfig.default_segment
:module: archledger.storage.project_config
:type: str .. py:attribute:: IdConfig.segment_map
:module: archledger.storage.project_config
:type: dict[str, str] .. py:attribute:: IdConfig.default_kind
:module: archledger.storage.project_config
:type: str .. py:attribute:: IdConfig.kind_map
:module: archledger.storage.project_config
:type: dict[str, str] .. py:method:: IdConfig.init(prefix: str, width: int, segment_mode: str, default_segment: str, segment_map: dict[str, str], default_kind: str, kind_map: dict[str, str]) -> None
:module: archledger.storage.project_config .. py:class:: LedgerConfig(code: ‘str’, name: ‘str’)
:module: archledger.storage.project_config
:canonical: archledger.config.model.LedgerConfig .. py:attribute:: LedgerConfig.code
:module: archledger.storage.project_config
:type: str .. py:attribute:: LedgerConfig.name
:module: archledger.storage.project_config
:type: str .. py:method:: LedgerConfig.init(code: str, name: str) -> None
:module: archledger.storage.project_config .. py:class:: SkillConfig(installed: ‘bool’, path: ‘str’)
:module: archledger.storage.project_config
:canonical: archledger.config.model.SkillConfig .. py:attribute:: SkillConfig.installed
:module: archledger.storage.project_config
:type: bool .. py:attribute:: SkillConfig.path
:module: archledger.storage.project_config
:type: str .. py:method:: SkillConfig.init(installed: bool, path: str) -> None
:module: archledger.storage.project_config .. py:class:: SourceConfig(format: ‘str’, schema_version: ‘int’, front_matter: ‘str’, section_extension: ‘str’, record_extension: ‘str’)
:module: archledger.storage.project_config
:canonical: archledger.config.model.SourceConfig .. py:attribute:: SourceConfig.format
:module: archledger.storage.project_config
:type: str .. py:attribute:: SourceConfig.schema_version
:module: archledger.storage.project_config
:type: int .. py:attribute:: SourceConfig.front_matter
:module: archledger.storage.project_config
:type: str .. py:attribute:: SourceConfig.section_extension
:module: archledger.storage.project_config
:type: str .. py:attribute:: SourceConfig.record_extension
:module: archledger.storage.project_config
:type: str .. py:method:: SourceConfig.init(format: str, schema_version: int, front_matter: str, section_extension: str, record_extension: str) -> None
:module: archledger.storage.project_config .. py:class:: TrackingConfig(enabled: ‘bool’, state_file: ‘str’, scanner: ‘str’, include: ‘tuple[str, …]’, exclude: ‘tuple[str, …]’, max_file_bytes: ‘int’, hash_algorithm: ‘str’)
:module: archledger.storage.project_config
:canonical: archledger.config.model.TrackingConfig .. py:attribute:: TrackingConfig.enabled
:module: archledger.storage.project_config
:type: bool .. py:attribute:: TrackingConfig.state_file
:module: archledger.storage.project_config
:type: str .. py:attribute:: TrackingConfig.scanner
:module: archledger.storage.project_config
:type: str .. py:attribute:: TrackingConfig.include
:module: archledger.storage.project_config
:type: tuple[str, …] .. py:attribute:: TrackingConfig.exclude
:module: archledger.storage.project_config
:type: tuple[str, …] .. py:attribute:: TrackingConfig.max_file_bytes
:module: archledger.storage.project_config
:type: int .. py:attribute:: TrackingConfig.hash_algorithm
:module: archledger.storage.project_config
:type: str .. py:method:: TrackingConfig.init(enabled: bool, state_file: str, scanner: str, include: tuple[str, …], exclude: tuple[str, …], max_file_bytes: int, hash_algorithm: str) -> None
:module: archledger.storage.project_config .. py:class:: LedgerIdFormat(prefix: ‘str’ = ‘al’, width: ‘int’ = 4, segment_mode: ‘str’ = ‘none’)
:module: archledger.storage.project_config
:canonical: archledger.ids.LedgerIdFormat .. py:attribute:: LedgerIdFormat.prefix
:module: archledger.storage.project_config
:type: str .. py:attribute:: LedgerIdFormat.width
:module: archledger.storage.project_config
:type: int .. py:attribute:: LedgerIdFormat.segment_mode
:module: archledger.storage.project_config
:type: str .. py:property:: LedgerIdFormat.pattern_text
:module: archledger.storage.project_config
:type: str .. py:property:: LedgerIdFormat.reference_pattern_text
:module: archledger.storage.project_config
:type: str .. py:method:: LedgerIdFormat.pattern() -> ~re.Pattern[str]
:module: archledger.storage.project_config .. py:method:: LedgerIdFormat.reference_pattern() -> ~re.Pattern[str]
:module: archledger.storage.project_config .. py:method:: LedgerIdFormat.format(number: int, *, segment: str | None = None) -> str
:module: archledger.storage.project_config .. py:method:: LedgerIdFormat.parse_parts(record_id: str) -> ~archledger.ids.ParsedLedgerId
:module: archledger.storage.project_config .. py:method:: LedgerIdFormat.parse(record_id: str) -> int
:module: archledger.storage.project_config .. py:method:: LedgerIdFormat.is_id(value: object) -> bool
:module: archledger.storage.project_config .. py:method:: LedgerIdFormat.init(prefix: str = ‘al’, width: int = 4, segment_mode: str = ‘none’) -> None
:module: archledger.storage.project_config .. py:function:: build_default_project_config(workspace_root: ~pathlib.Path, *, archledger_dir: str, source_format: str = ‘markdown’, ledger_code: str = ‘al’, id_prefix: str = ‘al’, id_width: int = 4, id_segment_mode: str = ‘none’, id_default_segment: str = ‘content’, id_segment_map: dict[str, str] | None = None, project_name: str | None = None, project_uuid: str | None = None, build_default_format: str | None = None, build_default_output: str | None = None, build_default_output_dir: str | None = None, build_include_draft: bool = False, build_include_superseded: bool = False, build_strict: bool = False, build_keep_intermediate: bool = False, build_converter: str = ‘auto’, build_pdf_engine: str = ‘’, build_reference_docx: str = ‘’, diagram_enabled: bool = False, diagram_renderer: str = ‘pass-through’, diagram_default_type: str = ‘text’, diagram_output_dir: str = ‘diagrams’, diagram_image_format: str = ‘svg’, diagram_kroki_url: str = ‘’, arc42_template_version: str = ‘9.0-EN’, arc42_language: str = ‘en’, arc42_title: str = ‘Architecture Documentation’, arc42_include_help: bool = False, tracking_enabled: bool = True, tracking_scanner: str = ‘auto’, tracking_state_file: str = ‘source-state.json’, tracking_max_file_bytes: int = 1000000, tracking_include: tuple[str, …] | None = None, tracking_exclude: tuple[str, …] | None = None, profile: str = ‘arc42’, extra_profiles: tuple[str, …] = ()) -> ~archledger.config.model.ProjectConfig
:module: archledger.storage.project_config .. py:function:: load_project_config(path: ~pathlib.Path) -> ~archledger.config.model.ProjectConfig
:module: archledger.storage.project_config .. py:function:: normalize_project_name(name: str) -> str
:module: archledger.storage.project_config .. py:function:: render_default_config(workspace_root: ~pathlib.Path, *, archledger_dir: str, source_format: str = ‘markdown’, project_name: str | None = None, project_uuid: str | None = None) -> str
:module: archledger.storage.project_config .. py:function:: render_project_config(config: ~archledger.config.model.ProjectConfig) -> str
:module: archledger.storage.project_config use project_name from context instead.
:type: Deprecated
Return the default profile name (back-compat accessor).
Return the structured profiles configuration.