Code Monkey home page Code Monkey logo

code-stats's Introduction

codestat Build Status

Code Stat is a command line tool to generate code statistics for a given directory.

Statistics

These statistics include

  1. Total lines of code per file Type / Language.
  2. Percentage wise break-up of different file Type / Language.
  3. Space occupied by each file Type / Language.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

codestats requires python 3 and the following packages to work.

  1. click
  2. pathlib
  3. tabulate
  4. pytest (only for testing purpose)

Installing Dependencies

pip install -r requirements.txt from the source code of the project.

Installing codestats

Installing from Source

codestats can be installed from the source which is available on github. To do this follow the instructions below.

  1. Copy the project from https://github.com/abhinavshaw1993/code-stats
  2. Run the setup.py file with the command python setup.py install
  3. codestats is ready for use.

Installing from pip

pip install code-stats

Using codestats

After installing -

  1. You can find statistics of a folder by running
codestats --path=path/to/folder
  1. 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
  1. You can see options available in codestats as codestats by
codestats --help

Sample example in Linux.

codestats

Running the tests

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.

  1. Testing the statistics generation.
  2. 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

Authors

Abhinav Shaw - Github

License

This project is licensed under the MIT License - see the LICENSE.md file for details

code-stats's People

Contributors

abhinavshaw1993 avatar

Stargazers

 avatar Ali Toyserkani avatar  avatar Ricky Das avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.