- Python 100%
|
|
||
|---|---|---|
| .forgejo | ||
| scripts | ||
| src/quik_stat | ||
| tests | ||
| .gitignore | ||
| pyproject.toml | ||
| README.md | ||
quik-stat
A small collection of simple CLI utilities for displaying stats about sets of files.
Currently quik-stat provides two utility commands, extat for showing statistics
about path suffixes (aka file extensions), and imstat for displaying information about
image files, e.g resolution, size, format etc.
Usage
Both the commands in the quik-stat package function by reading a set of files and
reporting statistics on those files on stdout. extat reports statistics about the
path suffixes (i.e. "file extensions") and imstat reports on simple image file
metadata, e.g image size, type, and file size, for each file. Both commands can evaluate
the set of files to process by walking the file tree from arbirary roots directories, or
can read in the file list from stdin.
Autosearch for files
Both commands take an optional list of positional arguments, each element of which is used as a root directory to search for files in (recursively):
extat path/to/root1 path/to/root2 path/to/root3 ...
imstat path/to/root1 path/to/root2 path/to/root3 ...
When these arguments are given, the set of files the command processes will be any and all applicable files reachable from any of the paths specified by the arguments.
Read fileset from stdin
For further control over the exact set of files processed, the positional arguments can
be omitted and the command will read the set of files to process from stdin. The
intended use pattern is using a filesystem search tool such as GNU
find,
fd, or in simple cases,
ls to generate a list of file paths which is then piped to the desired quik-stat
command:
# Report statistics on all files under `/some/root/path`
find some/root/path -type f | extat
# report stats on all jpg and webp files reachable from `some/root/path`
fd -e .webp -e .jpg . some/root/path | imstat
extat
extat provides statistics about the path suffixes (aka "file extensions") present in
the input list. This includes the number of paths with the suffix, the total number of
paths, analyzed, the percentage of all paths having the suffix, the total file size of
all files having the suffix, and the portion of total set file size represented by the
suffix.
imstat
imstat works the same way extat does, but is designed to only process image files,
e.g. jpeg files, and
webp files, and instead of printing statistics
about the path suffixes, it prints information about each file's image metadata, e.g.
resolution and file size info