document-analyser
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.
Install
pip install document-analyser
Requires Python 3.11+.
Usage
Python
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])
CLI
# Human-readable summary
document-analyser report.pdf
# Machine-readable JSON
document-analyser thesis.docx --json
# Start the HTTP server
document-analyser serve --port 8000
HTTP API
curl -X POST http://localhost:8000/analyse \
-F "file=@report.pdf"
Supported formats
| Format | Extensions |
|---|---|
.pdf |
|
| Word | .docx |
| PowerPoint | .pptx |
| Plain text | .txt .md |
Output
{
"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
}
}
The analyser family
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 |
Licence
MIT
Metadata
Release files for document-analyser 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| document_analyser-0.10.0.tar.gz | 269.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| document_analyser-0.10.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 351.8 kB
Release files / document_analyser-0.10.0.tar.gz
| Download URL | document_analyser-0.10.0.tar.gz |
|---|---|
| Size | 269.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4720d93ee21d49b517aaa4290b138027a1de0c840801e414f7e3550a04a3e38b
|
|
BLAKE2b-256 checksum How to use checksums |
04132fb6cf37cc3f379190dabb128a393ffa7e79b190f43bbd6725a3a85f829f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|
Release files / document_analyser-0.10.0-py3-none-any.whl
| Download URL | document_analyser-0.10.0-py3-none-any.whl |
|---|---|
| Size | 81.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a07b3fc4e6112aa3bffb5eef7273623a57e823e83c461353897bc30884eda9b7
|
|
BLAKE2b-256 checksum How to use checksums |
853cde68d963732a359b0bede47aa2482dc50b1dcc3a1ca6c0fbe3caa5d17346
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|