计算按文件扩展名记录的文件的计数和平均文件大小
storage_stats的Python项目详细描述
计算目录中每个文件扩展名的最小、最大和平均平均文件大小的统计信息。
安装
pip install storage_stats
文档
用法:storage_stats [-h][-e MAPFILE] [-o OUTPUT] [--no-aggregation][--no-recursion][--no-timing][-s][-v] path [path ...]
计算指定文件夹的文件大小统计信息。
- 位置参数:
- 要特征化的文件夹的路径
- 可选参数:
-h, --help Show the help message and exit -e MAPFILE User file overriding similar extension mappings -o OUTPUT CSV file to output statistics too --no-aggregation Do not aggregate results from all specified paths together --no-recursion Do not include sub-folders in stats --no-timing Turn off preprocessing of directory to improve run-time (no timing information provided) -s, --silent Turn off command line output (useful if you just want to output a CSV file) -v, --version Provide the version of this application
如果指定了多个文件夹,则结果将聚合在一起,除非使用–no聚合标志。 如果没有指定聚合和-o(输出csv文件)标志,则每个 输入文件夹(将“-<;index>;”附加到指定文件名的末尾,例如stats-1.csv、stats-2.csv等)
地图文件
mapfile应该是一个文本文件,每行有一组类似的文件扩展名,用逗号分隔。每条线 应为小写并采用以下格式:
.main_ext,.alt1,.alt2,etc
例如:
.jpeg,.jpg .tiff,.tif
注意每次延期的期限。
列出的第一个扩展名将是输出中引用的扩展名。
许可证
贡献
- Fork the GitHub project
- 更改代码并推入分叉项目
- Submit a pull request