Skip to main content
A command line tool to analyze the amount of lines and files under current directory.
It supports ‘line.select’ rules which works like ‘.gitignore’.

Installation

You can install, upgrade, uninstall line-counter.py with these commands:

$ pip install line-counter
$ pip install --upgrade line-counter
$ pip uninstall line-counter

Usage

Usage: line [options] [args]

Analyze the amount of lines and files under current directory following the
rules in 'line.select' or analyze all files if 'line.select' doesn't exist

Options:
  --version     show program's version number and exit
  -h, --help    show this help message and exit
  -d, --detail  show more detail in the result
  -s, --show    show rules in 'line.select'

Example usage and output

Analyze all files (when ‘line.select’ doesn’t exist) or specific files (when ‘line.select’ exists) under current directory.

$ line
Search in /Users/Morgan/Documents/Example/
file count: 4
line count: 839
Analyze all files (when ‘line.select’ doesn’t exist) or specific files (when ‘line.select’ exists) under current directory.
And show results in detail.
$ line -d
Search in /Users/Morgan/Documents/Example/
Dir A/file C.c                                             72
Dir A/file D.py                                           268
file A.py                                                 467
file B.c                                                   32
file count: 4
line count: 839

Show the rules in ‘line.select’

$ line -s
Here are the rules in 'line.select' under /Users/Morgan/Documents/Example/:
#Select rules:
*.c

#Ignore rules:
!Dir A
!*.py

Check current version

$ line --version
line 0.7.4

line.select

This file works like ‘.gitignore’. * Each line is a rule * Each line starts with a ‘#’ means that’s a comment * Each line starts with a ‘!’ means it’s a ignore rule * Otherwise it’s a select rule * The order of rules is irrelevant and ignore rules can always override select rules * The rules can find all the pathnames matching a specified pattern according to the rules used by the Unix shell. No tilde expansion is done, but *, ?, and character ranges expressed with [ ] will be correctly matched.

Roadmap

  • Add order output function

  • Add option to only count file amount or line amount

Change Log

  • 0.7.4 03/25/2017
    Fix distribution on PyPI.
  • 0.7.3 03/25/2017
    Fix the long description format on PyPI.
  • 0.7.2 03/25/2017
    Fix a bug that file cannot be matched when there is a ‘[’ in the path.

Author

I’m Morgan Zhang, a graduate computer science student in University of San Francisco.

Why I made it

I always want to know how many lines of code that I have done, but there isn’t a easy way to get it.
So I decide to make a tool for this.

Contact Information

MorganZhang100@gmail.com

License

The MIT license.

Metadata

Release files for line-counter 0.7.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for line-counter 0.7.4
File Size Uploaded
line-counter-0.7.4.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for line-counter 0.7.4
File Interpreter ABI Platform
line_counter-0.7.4-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 11.2 kB

Release files / line-counter-0.7.4.tar.gz

Download URL line-counter-0.7.4.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
44016e456970d6e453a2f46fd1423a83195de69d235c0754bd95b69a29255216
BLAKE2b-256 checksum
How to use checksums
b93611c28cd85456e3310684b7e9ad934ef712b786c1c74610e0e3b0f742b511
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / line_counter-0.7.4-py2.py3-none-any.whl

Download URL line_counter-0.7.4-py2.py3-none-any.whl
Size 6.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
704156df899011fde2a717af579e8e514172779b7bfdfa0c8a6dc6e542ab917f
BLAKE2b-256 checksum
How to use checksums
653087c634ec23bb553731201d18b5837e214725a731081f6ac1323346c65117
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.7.4 This release

2 release files

0.7.3

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page