A professional Flask web application for analyzing text documents and providing comprehensive statistics.
- Multi-Format Support: Analyze TXT, CSV, RTF, and DOCX files
- Comprehensive Statistics:
- Word count
- Character count (including spaces)
- Whitespace count (spaces, tabs, newlines)
- Line count
- Additional metrics (average word length, composition analysis)
- Professional UI: Modern, responsive design with Bootstrap
- Drag & Drop: Intuitive file upload with drag-and-drop functionality
- Real-time Processing: Fast document analysis with immediate results
- Error Handling: Robust file validation and error management
- Print Support: Print-friendly results page
Professional upload interface with drag-and-drop functionality and supported file format indicators.
Comprehensive statistics display with animated cards and detailed metrics breakdown.
- Python 3.7 or higher
- pip (Python package installer)
-
Clone the repository
git clone https://github.com/rrodrig30/count.git cd count -
Install dependencies
pip install -r requirements.txt
-
Run the application
python app.py
-
Access the application Open your web browser and navigate to
http://localhost:5001
Flask==2.3.3
python-docx==0.8.11
striprtf==0.0.24
Werkzeug==2.3.7
- Upload a Document: Click the upload area or drag and drop your file
- Supported Formats: TXT, CSV, RTF, DOCX files (max 16MB)
- Analyze: Click "Analyze Document" to process your file
- View Results: Get comprehensive statistics and metrics
- Print or Analyze More: Print results or upload another document
| Format | Extension | Description |
|---|---|---|
| Plain Text | .txt |
Standard text files with UTF-8/Latin-1 encoding |
| CSV | .csv |
Comma-separated values (analyzes all cell content) |
| Rich Text | .rtf |
Rich Text Format documents |
| Word Document | .docx |
Microsoft Word documents |
The application follows a clean, modular architecture:
count/
├── app.py # Main Flask application
├── templates/ # HTML templates
│ ├── index.html # Main upload interface
│ └── results.html # Results display page
├── static/ # Static assets (auto-created)
├── requirements.txt # Python dependencies
├── CLAUDE.md # Development documentation
└── README.md # This file
- DocumentProcessor: Handles file validation and text extraction
- TextAnalyzer: Performs statistical analysis on extracted text
- Flask Routes: Manages web requests and responses
- Templates: Professional UI with Bootstrap styling
- Host: 0.0.0.0 (accessible from network)
- Port: 5001 (configurable in app.py)
- Debug Mode: Enabled for development
- Max File Size: 16MB
- Allowed Extensions: txt, csv, rtf, docx, doc
- Secure filename processing
- File extension validation
- Temporary file cleanup
- CSRF protection
A sample test file is included:
# Test with the included sample
# Upload test_sample.txt through the web interface- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Flask web framework
- UI powered by Bootstrap
- Icons from Font Awesome
- Document processing libraries:
- python-docx for Word documents
- striprtf for RTF files
If you have any questions or need help with the application:
- Check the CLAUDE.md file for development guidance
- Open an issue on GitHub
- Review the error messages in the application for troubleshooting
python app.pyFor production deployment, consider using:
- Gunicorn:
gunicorn -w 4 -b 0.0.0.0:5001 app:app - Docker: Create a Dockerfile for containerized deployment
- Cloud Platforms: Deploy to Heroku, AWS, or Google Cloud
Copyright © 2025 Count Document Analyzer. All rights reserved.
Built with ❤️ using Flask and modern web technologies