CLI tools for collecting stats on images and file extentions
Find a file
2026-05-05 12:24:46 -04:00
.forgejo exp: try adding a PR Template for foregejo 2025-11-28 17:45:31 -05:00
scripts add: checker script 2025-11-28 18:15:48 -05:00
src/quik_stat doc: refactor docs for png 2026-05-05 12:10:20 -04:00
tests upd: improve humansize impl 2026-04-22 22:27:43 -04:00
.gitignore initial commit 2025-08-22 14:11:22 -04:00
pyproject.toml upd: improve humansize impl 2026-04-22 22:27:43 -04:00
README.md feat: builtin filesystem search 2026-04-25 23:42:10 -04:00

quik-stat

PyPI - Version Gitea Last Commit

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