docs/
├── examples/
│ ├── cli/
│ │ └── basic.sh # CLI usage examples
│ ├── api/
│ │ ├── basic.py # Basic Python API
│ │ └── advanced.py # Advanced Python API
│ └── outputs/
│ ├── schema-sample.json
│ └── report-sample.md
└── README.md # This file
- CLI Examples - Command-line usage patterns
- Python API Basic - Basic programmatic usage
- Python API Advanced - Advanced analysis
- Sample JSON Output
- Sample Markdown Report
See examples/cli/basic.sh for common patterns:
# Basic analysis
code2schema ./backend
# Generate all formats
code2schema ./backend --proto --md --html
# Full analysis with diagnostics
code2schema ./backend --proto --md --html --graph-summary --events --cyclesSee examples/api/ for programmatic usage:
from code2schema import extract_project, analyze
from code2schema.codegen import to_json, to_proto, to_markdown
modules = extract_project(Path("./backend"))
schema = analyze(modules)
# Export
Path("schema.json").write_text(to_json(schema))
Path("api.proto").write_text(to_proto(schema))
Path("report.md").write_text(to_markdown(schema))