Add extension_summary.py.

This commit is contained in:
voussoir 2020-02-06 11:51:30 -08:00
parent 220eff266f
commit 80e55383f2

17
extension_summary.py Normal file
View file

@ -0,0 +1,17 @@
import collections
from voussoirkit import spinal
counts = collections.Counter()
extensions = {}
walker = spinal.walk_generator()
for file in walker:
extensions.setdefault(file.extension, []).append(file)
counts[file.extension] += 1
for (extension, count) in counts.most_common():
files = extensions[extension]
print(f'{extension.with_dot}: {len(files)}')
if len(files) < 5:
for file in files:
print(f' {file.absolute_path}')