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
Built Distribution
File details
Details for the file constcheck-0.1.0.tar.gz
.
File metadata
- Download URL: constcheck-0.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.11+ Linux/5.16.18-200.fc35.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 355652c37756c25e7c14dbe5245258df7b6591c486d80c6d3f3299cbe121b636 |
|
MD5 | 2419e21019dab665364d8881766f3e93 |
|
BLAKE2b-256 | 1ff255dda4dde7681bb28539fa8ff700a93c18a7c79ddf5c4cc18af5374c813a |
File details
Details for the file constcheck-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: constcheck-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.11+ Linux/5.16.18-200.fc35.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a3d9af77d02b441ed2065866b2442da537100afafb7ea5d044a7d293677a29e |
|
MD5 | e29fccafd6517754145ace2484da13de |
|
BLAKE2b-256 | 984592b385fcd7edd6c2f9754138dc450f19b7fdd03f074ec5abdda07f4f87c0 |