API reference
- class archledger.repository.InitResult(workspace_root: 'Path', config_path: 'Path', archledger_dir: 'Path', created_paths: 'tuple[Path, ...]')[source]
- class archledger.repository.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')[source]
- class archledger.repository.CheckFinding(level: 'str', message: 'str', path: 'Path | None' = None)[source]
- class archledger.repository.CheckResult(errors: 'tuple[CheckFinding, ...]', warnings: 'tuple[CheckFinding, ...]')[source]
- errors: tuple[CheckFinding, ...]
- warnings: tuple[CheckFinding, ...]
- __init__(errors: tuple[CheckFinding, ...], warnings: tuple[CheckFinding, ...]) None
- class archledger.repository.ArchiveResult(record_id: 'str', source_path: 'Path', archive_path: 'Path', reason: 'str', already_archived: 'bool' = False)[source]
- class archledger.repository.DoctorRepair(kind: 'str', message: 'str', path: 'Path | None' = None, before: 'int | None' = None, after: 'int | None' = None)[source]
- class archledger.repository.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, ...]')[source]
- errors: tuple[CheckFinding, ...]
- warnings: tuple[CheckFinding, ...]
- repairs: tuple[DoctorRepair, ...]
- __init__(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, ...]) None
- class archledger.repository.ArchitectureRepository(paths: ProjectPaths, config: ProjectConfig)[source]
- __init__(paths: ProjectPaths, config: ProjectConfig) None[source]
- init(*, overwrite: bool = False) InitResult[source]
- status() StatusResult[source]
- list_records(*, include_draft: bool = False, include_superseded: bool = False, kind: str | None = None) list[ArchitectureRecord][source]
- load_all_records(*, include_sections: bool = True) list[ArchitectureRecord][source]
- get_record(record_id: str) ArchitectureRecord[source]
- check(*, strict: bool = False) CheckResult[source]
- archive_record(record_id: str, *, reason: str = '') ArchiveResult[source]
- doctor(*, repair: bool = False) DoctorResult[source]
- archledger.model.known_source_extensions(config: object) tuple[str, ...][source]
Return sorted tuple of all recognised source file extensions.
- class archledger.model.SourceRef(path: 'str', symbols: 'tuple[str, ...]', reason: 'str' = '')[source]
- class archledger.model.ArchitectureRecord(id: 'str', type: 'str', title: 'str', status: 'str', section: 'str', order: 'int', path: 'Path', metadata: 'dict[str, object]', body: 'str', source_refs: 'tuple[SourceRef, ...]' = ())[source]
- archledger.model.validate_record(record: ArchitectureRecord, *, id_format: LedgerIdFormat | None = None, expected_segment: str | None = None, id_prefix: str = 'al', id_width: int = 4) list[str][source]
- class archledger.model.SourceFormatSpec(extension: str, native_output: str, section_body_placeholder: str, empty_section_placeholder: str)[source]
All per-format attributes for a source format.
- archledger.model.source_format_spec(source_format: str) SourceFormatSpec[source]
Return the full spec for a source format.
- archledger.model.record_template_name_for_source_format(kind: str, source_format: str = 'markdown') str[source]
- archledger.model.section_filename_for(section_spec: SectionSpec, extension: str = '.md', *, id_prefix: str = 'al', id_width: int = 4, segment_mode: str = 'none', segment: str | None = None) str[source]
- archledger.model.filename_for(number: int, extension: str = '.md', *, id_prefix: str = 'al', id_width: int = 4, segment_mode: str = 'none', segment: str | None = None) str[source]
- archledger.model.is_visible_status(status: str, *, include_draft: bool, include_superseded: bool, include_archived: bool = False) bool[source]
- archledger.model.record_sort_key(record: ArchitectureRecord) tuple[int, int, str, int, str][source]
- class archledger.source_tracking.DirectoryState(path: 'str', sha256: 'str', file_count: 'int')[source]
- class archledger.source_tracking.SourceState(schema: 'str', project_uuid: 'str', project_name: 'str', created_at: 'str', updated_at: 'str', reason: 'str', scanner: 'dict[str, object]', files: 'dict[str, TrackedFile]', directories: 'dict[str, DirectoryState]')[source]
-
- files: dict[str, TrackedFile]
- directories: dict[str, DirectoryState]
- class archledger.source_tracking.ChangedFile(path: 'str', change: 'str', old_sha256: 'str | None' = None, new_sha256: 'str | None' = None)[source]
- class archledger.source_tracking.PossibleRename(old_path: 'str', new_path: 'str', sha256: 'str')[source]
- class archledger.source_tracking.ImpactedRecord(id: 'str', type: 'str', title: 'str', status: 'str', section: 'str', path: 'str', matched_refs: 'tuple[str, ...]')[source]
- class archledger.source_tracking.ChangeSet(baseline_exists: 'bool', baseline_updated_at: 'str | None', baseline_reason: 'str | None', current_scanned_at: 'str', 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, ...]' = ())[source]
-
- changed_files: tuple[ChangedFile, ...]
- possible_renames: tuple[PossibleRename, ...]
- impacted_records: tuple[ImpactedRecord, ...]
- __init__(baseline_exists: bool, baseline_updated_at: str | None, baseline_reason: str | None, current_scanned_at: str, 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, ...] = ()) None
- archledger.source_tracking.scan_workspace(paths: ProjectPaths, config: ProjectConfig, *, reason: str = 'manual', scanned_at: str | None = None) SourceState[source]
- archledger.source_tracking.diff_source_states(baseline: SourceState | None, current: SourceState) ChangeSet[source]
- archledger.source_tracking.resolve_impacts(records: list[ArchitectureRecord], changes: ChangeSet, *, include_draft: bool, include_superseded: bool) ChangeSet[source]
- class archledger.storage.project_config.Arc42Config(template_version: 'str', language: 'str', title: 'str', include_help: 'bool')[source]
- class archledger.storage.project_config.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]')[source]
-
- outputs: dict[str, BuildOutputConfig]
- class archledger.storage.project_config.BuildOutputConfig(enabled: 'bool | None' = None, tool: 'str | None' = None, pdf_engine: 'str' = '', reference_docx: 'str' = '')[source]
- class archledger.storage.project_config.DiagramConfig(enabled: 'bool', renderer: 'str', default_type: 'str', output_dir: 'str', image_format: 'str', kroki_url: 'str')[source]
- class archledger.storage.project_config.ProjectConfig(config_version: 'int', archledger_dir: 'str', project_uuid: 'str', project_name: 'str', id_prefix: 'str' = 'al', id_width: 'int' = 4, id_segment_mode: 'str' = 'none', id_default_segment: 'str' = 'content', id_segment_map: 'dict[str, str]'=<factory>, source_format: 'str' = 'markdown', source_schema_version: 'int' = 2, front_matter: 'str' = 'yaml', section_extension: 'str' = '.md', record_extension: 'str' = '.md', build_default_output: 'str' = 'architecture.md', build_default_format: 'str' = 'markdown', build_output_dir: 'str' = 'build', 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' = '', build_outputs: 'dict[str, dict[str, object]]'=<factory>, arc42_template_version: 'str' = '9.0-EN', arc42_language: 'str' = 'en', arc42_title: 'str' = 'Architecture Documentation', arc42_include_help: 'bool' = False, skill_installed: 'bool' = False, skill_path: 'str' = 'skills/archledger/SKILL.md', tracking_enabled: 'bool' = True, tracking_state_file: 'str' = 'source-state.json', tracking_scanner: 'str' = 'auto', tracking_include: 'tuple[str, ...]'=('**/*.py', '**/*.toml', '**/*.md', '**/*.adoc', '**/*.rst', '**/*.j2', '**/*.yaml', '**/*.yml', '**/*.json'), tracking_exclude: 'tuple[str, ...]'=('.git/**', '.venv/**', '**/__pycache__/**', '.mypy_cache/**', '.pytest_cache/**', '.ruff_cache/**', 'dist/**', 'build/**'), tracking_max_file_bytes: 'int' = 1000000, tracking_hash_algorithm: 'str' = 'sha256', 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' = '')[source]
-
- property source: SourceConfig
- property build: BuildConfig
- property arc42: Arc42Config
- property skill: SkillConfig
- property id_format: LedgerIdFormat
- property tracking: TrackingConfig
- property diagrams: DiagramConfig
- __init__(config_version: int, archledger_dir: str, project_uuid: str, project_name: str, id_prefix: str = 'al', id_width: int = 4, id_segment_mode: str = 'none', id_default_segment: str = 'content', id_segment_map: dict[str, str]=<factory>, source_format: str = 'markdown', source_schema_version: int = 2, front_matter: str = 'yaml', section_extension: str = '.md', record_extension: str = '.md', build_default_output: str = 'architecture.md', build_default_format: str = 'markdown', build_output_dir: str = 'build', 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 = '', build_outputs: dict[str, dict[str, object]]=<factory>, arc42_template_version: str = '9.0-EN', arc42_language: str = 'en', arc42_title: str = 'Architecture Documentation', arc42_include_help: bool = False, skill_installed: bool = False, skill_path: str = 'skills/archledger/SKILL.md', tracking_enabled: bool = True, tracking_state_file: str = 'source-state.json', tracking_scanner: str = 'auto', tracking_include: tuple[str, ...]=('**/*.py', '**/*.toml', '**/*.md', '**/*.adoc', '**/*.rst', '**/*.j2', '**/*.yaml', '**/*.yml', '**/*.json'), tracking_exclude: tuple[str, ...]=('.git/**', '.venv/**', '**/__pycache__/**', '.mypy_cache/**', '.pytest_cache/**', '.ruff_cache/**', 'dist/**', 'build/**'), tracking_max_file_bytes: int = 1000000, tracking_hash_algorithm: str = 'sha256', 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 = '') None
- class archledger.storage.project_config.IdConfig(prefix: 'str', width: 'int', segment_mode: 'str', default_segment: 'str', segment_map: 'dict[str, str]')[source]
- class archledger.storage.project_config.SourceConfig(format: 'str', schema_version: 'int', front_matter: 'str', section_extension: 'str', record_extension: 'str')[source]
- class archledger.storage.project_config.TrackingConfig(enabled: 'bool', state_file: 'str', scanner: 'str', include: 'tuple[str, ...]', exclude: 'tuple[str, ...]', max_file_bytes: 'int', hash_algorithm: 'str')[source]
- class archledger.storage.project_config.LedgerIdFormat(prefix: 'str' = 'al', width: 'int' = 4, segment_mode: 'str' = 'none')[source]
- archledger.storage.project_config.build_default_project_config(workspace_root: Path, *, archledger_dir: str, source_format: str = 'markdown', 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) ProjectConfig[source]
- archledger.storage.project_config.load_project_config(path: Path) ProjectConfig[source]
- archledger.storage.project_config.render_default_config(workspace_root: Path, *, archledger_dir: str, source_format: str = 'markdown', project_name: str | None = None, project_uuid: str | None = None) str[source]
- archledger.storage.project_config.render_project_config(config: ProjectConfig) str[source]