Check Python files for repeat use of strings
Project description
Check Python files for repeat use of strings
Installation
$ pip install constcheck
Usage
usage: constcheck [-h] [-f] [-n] [-v] [-c INT] [-l INT] [-p PATH] [-s STR]
- optional arguments:
- -h, --help
show this help message and exit
- -f, --filter
filter out empty results
- -n, --no-color
disable color output
- -v, --version
show version and exit
- -c INT, --count INT
minimum number of repeat strings
- -l INT, --len INT
minimum length of repeat strings
- -p PATH, --path PATH
path to check files for
- -s STR, --string STR
parse a string instead of a file
- constcheck will display the quantity of strings repeated for the:
path
each dir
individual files
The default length of strings to check for is 3
The default quantity of strings to check for repeats is also 3
>>> EXAMPLE = (
... 'STRING_1 = "Hey"'
... 'STRING_2 = "Hey"'
... 'STRING_3 = "Hey"'
... 'STRING_4 = "Hello"'
... 'STRING_5 = "Hello"'
... 'STRING_6 = "Hello"'
... 'STRING_7 = "Hello"'
... 'STRING_8 = "Hello, world!"'
... 'STRING_9 = "Hello, world!"'
... 'STRING_10 = "Hello, world!"'
... 'STRING_11 = "Hello, world!"'
... 'STRING_12 = "Hello, world!"'
... )
>>>
>>> import constcheck
>>> constcheck.main(string=EXAMPLE, no_color=True)
"3 | Hey"
"4 | Hello"
"5 | Hello, world!"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
constcheck-0.1.0.tar.gz
(8.3 kB
view hashes)
Built Distribution
Close
Hashes for constcheck-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a3d9af77d02b441ed2065866b2442da537100afafb7ea5d044a7d293677a29e |
|
MD5 | e29fccafd6517754145ace2484da13de |
|
BLAKE2b-256 | 984592b385fcd7edd6c2f9754138dc450f19b7fdd03f074ec5abdda07f4f87c0 |