Skip to main content

Check Python files for repeat use of strings

Project description

ci python3.8 pypi codecov.io mit black

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


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 details)

Uploaded Source

Built Distribution

constcheck-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

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

Hashes for constcheck-0.1.0.tar.gz
Algorithm Hash digest
SHA256 355652c37756c25e7c14dbe5245258df7b6591c486d80c6d3f3299cbe121b636
MD5 2419e21019dab665364d8881766f3e93
BLAKE2b-256 1ff255dda4dde7681bb28539fa8ff700a93c18a7c79ddf5c4cc18af5374c813a

See more details on using hashes here.

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

Hashes for constcheck-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a3d9af77d02b441ed2065866b2442da537100afafb7ea5d044a7d293677a29e
MD5 e29fccafd6517754145ace2484da13de
BLAKE2b-256 984592b385fcd7edd6c2f9754138dc450f19b7fdd03f074ec5abdda07f4f87c0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page