A user-friendly, interactive terminal application for counting lines in any type of file
- 🎨 User-Friendly TUI Interface - Clean, colorblind-friendly terminal user interface
- 📁 Interactive Directory Picker - Browse and select directories with ease
- 🔍 Multi-Extension Support - Count lines across multiple file types simultaneously
- 🚫 Smart Filtering - Automatically ignores common development directories
- 📊 Detailed Analytics - Per-extension breakdowns and comprehensive summaries
- ⚡ Real-time Results - See results as files are processed
- 🎯 Customizable Ignore Rules - Add your own directories to ignore
-
Clone the repository
git clone https://github.com/yourusername/FileLineCounter.git cd FileLineCounter -
Install dependencies
pip install -r requirements.txt
-
Run the application
python app.py
- Launch the app and you'll see an interactive directory picker
- Select a directory either by browsing the tree or entering a path
- Choose file extensions (e.g.,
py js ts html css) - Optionally add extra ignore rules for directories specific to your project
- Watch the results stream in real-time!
- Textual - Modern TUI framework for Python
- pathlib - Modern path handling
- asyncio - Asynchronous processing for real-time updates
The application is built as a single-file Textual app with the following key components:
FileLineCounterApp- Main application class handling UI statescount_lines_in_files()- Core counting logic with async streaming- Smart Filtering - Configurable ignore patterns for common dev directories
The app automatically ignores common development directories:
# Virtual environments
.venv, venv, .env, env
# Node.js
node_modules, .npm
# Version control
.git, .svn, .hg
# Python cache
__pycache__, .pytest_cache
# Build directories
build, dist, target
# IDE directories
.idea, .vscode
# And more...- File Analysis - Get quick insights into any project's file structure and size
- Documentation Projects - Count lines in markdown, text, and documentation files
- Code Reviews - Understand the scope of changes in software projects
- Content Analysis - Analyze writing projects, scripts, configuration files
- Project Planning - Estimate development or writing effort
- Portfolio Statistics - Showcase your work volume across any file type
- Team Metrics - Compare project sizes across teams and file types
During the setup process, you can add project-specific directories to ignore:
Extra directories to ignore: build dist myfolder
The app supports any file extension. Common examples:
- Web Development:
html css js ts jsx tsx - Programming:
py java cpp c h kt swift go rs php rb - Data & Config:
sql json yaml yml xml csv ini toml - Documentation:
md txt rst adoc - Markup & Styling:
html css scss sass less - Scripts & Automation:
sh bash ps1 bat cmd
FileLineCounter/
├── app.py # Main application (all logic)
├── requirements.txt # Python dependencies
├── README.md # This file
- Single File Architecture - All logic contained in
app.pyfor simplicity - Async Processing - Real-time streaming of results
- Colorblind Friendly - Accessible color scheme
- Minimal Dependencies - Only essential packages required
# Standard run
python app.py
# With debugging
python -u app.py # Unbuffered output for debuggingContributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes following the existing code style
- Test your changes thoroughly
- Commit your changes (
git commit -m 'Add amazing feature') - Push to your branch (
git push origin feature/amazing-feature) - Open a Pull Request
- All logic should remain in
app.py(single-file architecture) - Follow existing code style and patterns
- Test with various directory structures and file types
- Ensure accessibility (colorblind-friendly design)
- Python 3.8 or higher
- Dependencies (automatically installed):
textual- TUI frameworkrich- Text formatting (Textual dependency)markdown-it-py- Markdown processing (Textual dependency)
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with the amazing Textual framework
- Inspired by the need for better file analysis tools
- Thanks to the Python community for excellent libraries
If you encounter any issues or have questions:
- Check existing issues in the GitHub repository
- Create a new issue with detailed information
- Include your Python version and operating system
- Provide steps to reproduce any bugs
Happy coding! 🚀
Made with ❤️ and Python
