This tool analyzes public documentation (e.g., MoEngage docs) and provides a structured report evaluating:
- Readability
- Structure & Flow
- Completeness & Examples
- Style Guidelines
Optionally, it can also revise the content based on suggestions generated.
- Evaluate readability using metrics like Flesch Reading Ease and Gunning Fog Index.
- Assess structural quality: headings, paragraph flow, and list usage.
- Check completeness: presence of explanations, examples, and step-by-step instructions.
- Evaluate writing style against the Microsoft Style Guide.
- Optionally rewrite content to improve clarity, flow, and readability.
document_analyzer/
│
├── analyzer/ # Core orchestration scripts
│ ├── __init__.py
│ ├── analyzer.py # Main CLI entry point
│ ├── analyzer_logic.py # Orchestrates various assessment modules
│ ├── report_generator.py # Aggregates results into structured output
│ └── revision_agent.py # Optional agent to revise text
│
├── modules/ # Individual functional modules
│ ├── __init__.py
│ ├── completeness.py # Completeness & examples checker
│ ├── readability.py # Readability metrics calculator
│ ├── structure.py # Checks structure and flow
│ ├── style.py # Evaluates style guideline adherence
│ ├── scraper.py # Scrapes content using Selenium
│ └── utils.py # Helper functions (e.g., text cleaner)
│
├── reports/ # Generated or example reports
│ ├── example_report.json
│ └── report.json
│
├── requirements.txt # Python package dependencies
├── README.md # Project documentation
├── LICENSE
└── venv/ # Virtual environment (optional)
git clone https://github.com/saniyaacharya04/document_analyzer.git
cd document_analyzerpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install --upgrade setuptools # Ensure pkg_resources is available
pip install -r requirements.txtpython -m analyzer.analyzer "https://help.moengage.com/hc/en-us/articles/4415622460948-Push-Templates" -o reports/report.jsonThis command will:
- Fetch the article via Selenium
- Analyze it across Readability, Structure, Completeness, and Style
- Save a structured JSON report to
reports/report.json
If you created run_analysis.sh:
./run_analysis.sh "https://help.moengage.com/hc/en-us/articles/4415622460948-Push-Templates"The report will be saved automatically in reports/report.json.
{
"url": "https://help.moengage.com/hc/en-us/articles/4415622460948-Push-Templates",
"readability": {
"flesch_reading_ease": 47.43,
"gunning_fog_index": 9.47,
"feedback": "Moderate difficulty."
},
"structure_and_flow": {
"assessment": "Add more headings for better navigation. Use bullet or numbered lists to improve readability."
},
"completeness_and_examples": {
"assessment": "No clear examples or step-by-step instructions detected. Consider adding some."
},
"style_guidelines": {
"assessment": "Style is clear, concise, and user-friendly."
}
}You can use revision_agent.py to revise documentation with suggested improvements:
python analyzer/revision_agent.py input_article.txt suggestions.json -o reports/revised_output.md- Uses Selenium with headless Chrome for scraping content that blocks requests.
- Ensure Google Chrome is installed and
chromedriveris configured in your PATH. - The
textstatwarning aboutpkg_resourcesis harmless and can be ignored.
Style recommendations are based on the Microsoft Writing Style Guide:
- Clear and concise writing
- Friendly, conversational tone
- Step-by-step instructions instead of passive descriptions
- Consistent use of headings, lists, and examples
This project is licensed under the MIT License.