55 modules | 298 functions | 60 classes
| Module | Lines | Functions | Classes | CC avg | Description | Source |
|---|---|---|---|---|---|---|
code2docs |
24 | 1 | 0 | 4.0 | code2docs - Auto-generate and sync project documentation fro | source |
code2docs.analyzers.dependency_scanner |
248 | 0 | 3 | 6.0 | Scan project dependencies from requirements.txt, pyproject.t | source |
code2docs.analyzers.docstring_extractor |
140 | 0 | 2 | 3.5 | Extract and analyze docstrings from source code. | source |
code2docs.analyzers.endpoint_detector |
113 | 0 | 2 | 4.0 | Detect web framework endpoints (Flask, FastAPI, Django) from | source |
code2docs.analyzers.project_scanner |
42 | 1 | 1 | 1.2 | Wrapper around code2llm's ProjectAnalyzer for documentation | source |
code2docs.base |
46 | 0 | 2 | 1.0 | Base generator interface and generation context. | source |
code2docs.cli |
245 | 13 | 1 | 3.4 | CLI interface for code2docs. | source |
code2docs.config |
155 | 0 | 7 | 3.4 | Configuration for code2docs documentation generation. | source |
code2docs.formatters.badges |
52 | 2 | 0 | 7.5 | Badge generation using shields.io URLs. | source |
code2docs.formatters.markdown |
73 | 0 | 1 | 1.2 | Markdown formatting utilities. | source |
code2docs.formatters.toc |
63 | 3 | 0 | 3.3 | Table of contents generator from Markdown headings. | source |
code2docs.generators |
59 | 1 | 0 | 5.0 | Documentation generators — produce Markdown, examples, and d | source |
code2docs.generators._registry_adapters |
290 | 0 | 15 | 2.4 | — | source |
code2docs.generators._source_links |
76 | 0 | 1 | 3.0 | Helper for generating source code links in documentation. | source |
code2docs.generators.api_changelog_gen |
196 | 0 | 2 | 5.4 | API changelog generator — diff function/class signatures bet | source |
code2docs.generators.api_reference_gen |
163 | 0 | 1 | 8.7 | API reference documentation generator — single consolidated | source |
code2docs.generators.architecture_gen |
294 | 0 | 1 | 6.9 | Architecture documentation generator with Mermaid diagrams. | source |
code2docs.generators.changelog_gen |
121 | 0 | 2 | 3.5 | Changelog generator from git log and API diff. | source |
code2docs.generators.code2llm_gen |
206 | 2 | 1 | 7.0 | code2llm integration generator — produces analysis files in | source |
code2docs.generators.config_docs_gen |
125 | 0 | 1 | 4.2 | Configuration documentation generator. | source |
code2docs.generators.contributing_gen |
231 | 0 | 1 | 4.6 | CONTRIBUTING.md generator from project tooling detection. | source |
code2docs.generators.coverage_gen |
104 | 0 | 1 | 4.4 | Docstring coverage report generator. | source |
code2docs.generators.depgraph_gen |
140 | 0 | 1 | 3.9 | Dependency graph generator — Mermaid diagram from coupling m | source |
code2docs.generators.examples_gen |
456 | 0 | 1 | 6.1 | — | source |
code2docs.generators.getting_started_gen |
196 | 0 | 1 | 7.1 | Getting Started guide generator. | source |
code2docs.generators.mkdocs_gen |
110 | 0 | 1 | 3.2 | MkDocs configuration generator — auto-generate mkdocs.yml fr | source |
code2docs.generators.module_docs_gen |
198 | 0 | 1 | 8.0 | Module documentation generator — single consolidated modules | source |
code2docs.generators.org_readme_gen |
227 | 0 | 1 | 5.2 | Organization README generator - generates overview of multip | source |
code2docs.generators.readme_gen |
322 | 1 | 1 | 6.0 | — | source |
code2docs.llm_helper |
161 | 1 | 1 | 2.3 | LLM helper — optional LLM-assisted documentation generation | source |
code2docs.registry |
35 | 0 | 1 | 2.5 | Generator registry — pluggable generator system. | source |
code2docs.sync.differ |
125 | 0 | 2 | 3.6 | Detect changes in source code for selective documentation re | source |
code2docs.sync.updater |
51 | 0 | 1 | 3.0 | Selectively regenerate documentation for changed modules. | source |
code2docs.sync.watcher |
75 | 1 | 0 | 5.0 | File watcher for auto-resync on source changes (requires wat | source |
examples.01_cli_usage |
70 | 2 | 0 | 1.0 | Example 1: CLI Usage - Generate documentation from command l | source |
examples.02_configuration |
161 | 4 | 0 | 1.0 | Example 2: Configuration - Set up code2docs with custom sett | source |
examples.03_programmatic_api |
85 | 5 | 0 | 2.4 | Example 3: Programmatic API - Use code2docs in your Python c | source |
examples.04_sync_and_watch |
120 | 6 | 0 | 2.2 | — | source |
examples.05_custom_generators |
144 | 1 | 3 | 2.2 | Example 5: Custom Generators - Build your own documentation | source |
examples.06_formatters |
96 | 5 | 0 | 1.6 | Example 6: Formatters and Utilities - Working with markdown | source |
examples.07_web_frameworks |
221 | 5 | 0 | 4.2 | Example 7: Web Framework Integration - Document Flask/FastAP | source |
code2docs.config source
Configuration for code2docs documentation generation.
Code2DocsConfig source
: Main configuration for code2docs.
| Method | Args | Returns | CC |
|---|---|---|---|
from_yaml |
cls, path |
— |
10 |
to_yaml |
path |
— |
1 |
Code2LlmConfig source
: Configuration for code2llm analysis generation.
DocsConfig source
: Configuration for docs/ generation.
ExamplesConfig source
: Configuration for examples/ generation.
LLMConfig source
: Configuration for optional LLM-assisted documentation generation.
| Method | Args | Returns | CC |
|---|---|---|---|
from_env |
cls |
— |
1 |
ReadmeConfig source
: Configuration for README generation.
SyncConfig source
: Configuration for synchronization.
code2docs.formatters.badges source
Badge generation using shields.io URLs.
generate_badges(project_name, badge_types, stats, deps)— Generate shields.io badge Markdown strings. source
code2docs.generators source
Documentation generators — produce Markdown, examples, and diagrams.
generate_docs(project_path, config)— High-level function to generate all documentation. source
code2docs.generators.code2llm_gen source
code2llm integration generator — produces analysis files in project/ folder.
Code2LlmGenerator source
: Generate code2llm analysis files in project/ directory.
| Method | Args | Returns | CC |
|---|---|---|---|
generate_all |
`` | — |
5 |
get_analysis_summary |
`` | — |
2 |
generate_code2llm_analysis(project_path, config)— Convenience function to generate code2llm analysis. sourceparse_gitignore(project_path)— Parse .gitignore file and return list of patterns to exclude. source
code2docs.generators.org_readme_gen source
Organization README generator - generates overview of multiple projects.
OrgReadmeGenerator source
: Generate organization README with list of projects and brief descriptions.
| Method | Args | Returns | CC |
|---|---|---|---|
generate |
`` | — |
2 |
write |
output_path, content |
— |
1 |
code2docs.sync.watcher source
File watcher for auto-resync on source changes (requires watchdog).
start_watcher(project_path, config)— Start watching project for file changes and auto-resync docs. source
examples.01_cli_usage source
Example 1: CLI Usage - Generate documentation from command line.
run_cli_basic(project_path)— Run code2docs CLI programmatically. sourcerun_cli_with_config(project_path, config_path)— Run with custom configuration. source
examples.02_configuration source
Example 2: Configuration - Set up code2docs with custom settings.
create_advanced_config()— Create advanced configuration with all options. sourcecreate_basic_config()— Create a basic configuration. sourceload_config_from_yaml(path)— Load configuration from YAML file. sourcesave_yaml_config_example(path)— Save example YAML config to file. source
examples.05_custom_generators source
Example 5: Custom Generators - Build your own documentation generator.
APIChangelogGenerator source
: Generate changelog based on API changes.
| Method | Args | Returns | CC |
|---|---|---|---|
generate |
previous_result |
— |
8 |
CustomGenerator (BaseGenerator) source
: Example of extending the base generator class.
| Method | Args | Returns | CC |
|---|---|---|---|
generate |
`` | — |
1 |
write |
path, content |
— |
1 |
MetricsReportGenerator source
: Generate a metrics report from code analysis.
| Method | Args | Returns | CC |
|---|---|---|---|
generate |
`` | — |
1 |
generate_custom_report(project_path)— Generate a custom metrics report. source
examples.06_formatters source
Example 6: Formatters and Utilities - Working with markdown formatting.
badge_examples()— Generate various badge examples. sourcebuild_custom_readme()— Build a custom README using formatters. sourcegenerate_complex_document()— Generate a complex markdown document using the formatter. sourcemarkdown_formatting_examples()— Demonstrate markdown formatting utilities. sourcetoc_examples()— Demonstrate table of contents generation. source
examples.07_web_frameworks source
Example 7: Web Framework Integration - Document Flask/FastAPI endpoints.
create_example_web_apps(target_dir)— Create example Flask and FastAPI apps for testing. sourcedetect_fastapi_endpoints(project_path)— Detect FastAPI endpoints in a project. sourcedetect_flask_endpoints(project_path)— Detect Flask endpoints in a project. sourcedocument_web_project(project_path)— Complete workflow: detect endpoints and generate docs. sourcegenerate_api_docs_from_endpoints(project_path, output_dir)— Generate API documentation from detected endpoints. source