Skip to content

A set of things that can be done with files. For example, finding the number of lines in a file Find the number of words Find the net code count of a Python file And ...

License

Notifications You must be signed in to change notification settings

ashkan0201/ashcount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ashcount

This package helps you to get some information from the files.

  • Find the number of lines in a file
  • Find the number of original lines in a file
  • Find the word count of a file
  • Find the number of codes in a Python file
  • Find the net code count of a Python file
  • Find the number of comments in a Python file

You can find the above items using this package.

How to use modules

It is very easy to use modules, now we will give some examples. The output will be a number in all modes.

pip install ashcount

First, we import the ashcount from ashcount

from ashcount import ashcount

The files you use for it must have their addresses to avoid problems!

Txt_file_address = 'example.txt'
Python_file_address = 'example.py'

For example, to find the number of lines in a txt file.

print(ashcount.counter.line_counter(path=Txt_file_address))

To get the number of main lines of a txt file.

In this section, we do not consider lines that are empty or only have extra spaces.

print(ashcount.counter.counting_main_lines(path=Txt_file_address))

To find the number of words in a txt file.

print(ashcount.counter.word_count(path=Txt_file_address))

For the part where you want to work with Python files, you must import ashcount from ashcount.

from ashcount import ashcount

And also to find the number of codes in a python file.

print(ashcount.py_counter.python_line_count(path=Python_file_address))

To find the net number of codes in a Python file.

In this section, we do not consider comments and lines that do not have any code, and we will give you the net number of a code.

print(ashcount.py_counter.pure_python_code(path=Python_file_address))

And finally, to find the number of comments in a Python file.

print(ashcount.py_counter.python_comment_count(path=Python_file_address))

Ways of communication

Contact me in case of problems.

About

A set of things that can be done with files. For example, finding the number of lines in a file Find the number of words Find the net code count of a Python file And ...

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published