A comprehensive Flask-based text analysis application with advanced natural language processing capabilities, database integration, and robust architecture.
- Advanced text analysis metrics
- Word count and character analysis
- Readability score calculation
- Sentiment analysis
- Word frequency distribution
- JWT authentication
- Database persistence
- Docker containerization
- Python 3.8+
- Flask
- SQLAlchemy
- PostgreSQL
- NLTK
- TextBlob
- Docker
- JWT Authentication
text-analyzer/
│
├── app/
│ ├── services/
│ ├── models/
│ ├── routes/
│ └── utils/
│
├── config/
├── tests/
└── requirements.txt
# Clone repository
git clone https://github.com/zahidhasann88/text-analyzer.git
cd text-analyzer
# Create virtual environment
python3 -m venv venv
source venv/bin/activate #gitbash
venv\Scripts\activate #cmd
.\venv\Scripts\activate #powershall
# Install dependencies
pip install -r requirements.txt
# Configure database
createdb textanalyzer
# Run migrations
flask db upgrade
# Start application
python run.py
# test application
pytest tests
# Build and run
docker-compose up --build
POST /api/analyze
: Text analysis endpoint- Requires JWT authentication
- Payload:
{"text": "Sample text to analyze"}
- Total word count
- Unique words
- Sentence count
- Readability scores
- Word frequency
- Sentiment analysis
# Run tests
pytest tests/
# Check coverage
coverage run -m pytest
coverage report
- JWT-based authentication
- Secure token management
- Rotating file handlers
- Console and file logging
- Configurable log levels