Extracts text from documents and returns readability metrics, word counts, and structural information. Accepts PDF, DOCX, PPTX, and plain text formats.
Part of the analyser family.
pip install document-analyserRequires Python 3.11+.
from app.analyser import DocumentAnalyser
result = DocumentAnalyser().analyse("report.pdf")
print(f"Words: {result['word_count']}")
print(f"Sentences: {result['sentence_count']}")
print(f"Readability: {result['readability']['flesch_reading_ease']:.1f} (Flesch)")
print(result["text"][:500])# Human-readable summary
document-analyser report.pdf
# Machine-readable JSON
document-analyser thesis.docx --json
# Start the HTTP server
document-analyser serve --port 8000curl -X POST http://localhost:8000/analyse \
-F "file=@report.pdf"| Format | Extensions |
|---|---|
.pdf |
|
| Word | .docx |
| PowerPoint | .pptx |
| Plain text | .txt .md |
{
"format": "pdf",
"file_path": "/path/to/report.pdf",
"file_size": 204800,
"page_count": 12,
"word_count": 4823,
"sentence_count": 312,
"paragraph_count": 89,
"text": "Executive summary...",
"readability": {
"flesch_reading_ease": 52.3,
"flesch_kincaid_grade": 11.2,
"gunning_fog": 13.8,
"smog_index": 12.1,
"automated_readability_index": 11.9
}
}Low-level analysis tools. Each accepts files directly and returns structured JSON. Build your own UI or pipeline on top.
| Package | Handles |
|---|---|
| speech-analyser | audio and video files — transcript and speech metrics |
| video-analyser | video files — frames, scenes, and visual quality |
| document-analyser | PDF, DOCX, PPTX, TXT — text and readability |
| code-analyser | source code — style, complexity, and quality metrics |
| records-analyser | CSV, Excel, SQLite, Parquet, JSON — data profiling |
| auto-analyser | any file — detects format and routes to the right tool |
MIT