Skip to main content

Get character frequency inside files

Project description

charfreq

Get the frequency of characters in your files! Outputs JSON with character counts

Install

pip3 install charfreq

Example usage

charfreq --only "[()]" ./**/*.py

This outputs the following JSON

{
    "(": 83281,
    ")": 83286
}

More random examples

# Have a look at the options available
charfreq --help

# Check a file
charfreq script.py

# Check many files
charfreq script.py test.py api.js

# Test all py files recursively using glob (only tested on bash shell)
charfreq ./**/*.py

# Use multiple globs! (only tested on bash shell)
charfreq ./**/*.py ./**/*.html

# Exclude characters based on regex
charfreq --exclude "[a-zA-Z]" ./**/*.py

# Only capture characters based on regex
charfreq --only "[a-zA-Z]" ./**/*.py

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

charfreq-23.8.2.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

charfreq-23.8.2-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

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