On this page
Language extractor registry module that manages Python, Go, and TypeScript extractors and provides auto-detection of project language from marker files.
#selfdoc.extractors
#selfdoc.extractors
Language extractor registry and auto-detection.
#SourceEntry
A resolved source path with its language and extractor.
#detect_language
def detect_language(dir_path: str) -> str | NoneAuto-detect the project language from marker files in dir_path.
Tries Python first, then Go, then TypeScript (matching cli.py priority). Returns the extractor name or None if no language is detected.
#detect_languages
def detect_languages(dir_path: str) -> list[dict[str, str]]Detect ALL languages present in a directory.
Unlike detect_language which returns only the first match, this returns all detected languages with their source paths.
Returns a list of {"path": ..., "language": ...} dicts.
#resolve_source_entries
def resolve_source_entries(config: dict) -> list[SourceEntry]Resolve config source entries into SourceEntry objects.
Each source entry dict has 'path' and 'language' keys. The language is looked up in the extractor registry.
#source_paths
def source_paths(config: dict) -> list[str]Extract just the source path strings from config.