Code Stat is a command line tool to generate code statistics for a given directory.
These statistics include
- Total lines of code per file Type / Language.
- Percentage wise break-up of different file Type / Language.
- Space occupied by each file Type / Language.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
codestats requires python 3 and the following packages to work.
- click
- pathlib
- tabulate
- pytest (only for testing purpose)
pip install -r requirements.txt
from the source code of the project.
codestats can be installed from the source which is available on github. To do this follow the instructions below.
- Copy the project from https://github.com/abhinavshaw1993/code-stats
- Run the
setup.py
file with the commandpython setup.py install
- codestats is ready for use.
pip install code-stats
After installing -
- You can find statistics of a folder by running
codestats --path=path/to/folder
- You can exclude files by ignoring extensions using the --ignore_extensions argument which accepts comma separated extensions.
codestats --path=path/to/folder --ignore_extensions=csv,json,etc
- You can see options available in codestats as codestats by
codestats --help
Sample example in Linux.
These tests are useful if you want to extend codestats. For the time being I am not accepting any pull-requests but ideas and bugs as issues are welcome.
There are few tests in codestats.
- Testing the statistics generation.
- Testing the util functions.
To run these tests first you need pytest. Instructions on how to install pytest have been given above. Test codestats using
python setup.py test
or from the code_stats directory
pytest ./code_stats
Abhinav Shaw - Github
This project is licensed under the MIT License - see the LICENSE.md file for details