Text Analyzer
A typed command-line tool for text file analysis.
Requirements
- Python 3.12+
Installation
Create a virtual environment:
python3 -m venv .venv
Activate it:
source .venv/bin/activate
Install dependencies:
python -m pip install -r requirements.txt
Install the package in editable mode:
python -m pip install -e .
Usage
Basic analysis:
text-analyzer sample.txt
Show the three most frequent words:
text-analyzer sample.txt --top 3
Set minimum word length:
text-analyzer sample.txt --min-len 4
JSON output:
text-analyzer sample.txt --format json
Specify encoding:
text-analyzer sample.txt --encoding utf-8
Development checks
Type checking:
mypy src
Linting:
ruff check .
Formatting:
ruff format --check .
Tests and coverage:
pytest
Current test results
- 15 tests passed
- Core coverage: 96%
Description
Languages
Python
100%