Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashkan0201/ashcount
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 ...
https://github.com/ashkan0201/ashcount
documentation python3 testing
Last synced: about 1 month ago
JSON representation
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 ...
- Host: GitHub
- URL: https://github.com/ashkan0201/ashcount
- Owner: ashkan0201
- License: mit
- Created: 2023-10-04T19:27:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-19T11:35:07.000Z (about 1 year ago)
- Last Synced: 2024-11-11T06:21:35.314Z (about 1 month ago)
- Topics: documentation, python3, testing
- Language: Python
- Homepage:
- Size: 2.67 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 fileYou 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.```bash
pip install ashcount
```First, we import the `ashcount` from `ashcount`
```python
from ashcount import ashcount
```The files you use for it must have their addresses to avoid problems!
```python
Txt_file_address = 'example.txt'
Python_file_address = 'example.py'
```For example, to find the number of `lines` in a `txt` file.
```python
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.
```python
print(ashcount.counter.counting_main_lines(path=Txt_file_address))
```To find the number of `words` in a `txt` file.
```python
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`.
```python
from ashcount import ashcount
```And also to find the number of `codes` in a `python` file.
```python
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.
```python
print(ashcount.py_counter.pure_python_code(path=Python_file_address))
```And finally, to find the number of `comments` in a `Python` file.
```python
print(ashcount.py_counter.python_comment_count(path=Python_file_address))
```## Ways of communication
Contact me in case of problems.
- [email protected]
- [github](https://github.com/ashkan0201)