A lightweight Python module that does the dirty file-system work so you don't have to.
It scans a directory, classifies files by type, computes useful statistics, and prints a clean breakdown of what's inside β from images to documents to code files and more.
It also ships with helper utilities for converting byte sizes, formatting timestamps, and performing simple dictionary lookups.
The directory_audit() function:
- Scans a target directory
- Automatically sorts files into categories:
- Images
- Documents
- Videos
- Music
- Code/Scripts
- Archives
- Other files
- Computes:
- Total size (MB)
- File count
- Newest and oldest files
- Largest files (top 3)
-
convert_to_megabytes(bytes)
Converts raw byte sizes into clean, rounded MB values. -
find_key_dict(dictionary, value)
Retrieves a key from a dictionary based on matching value. -
format_date(timestamp)
Turns a UNIX timestamp into a clean, human-readable UTC datetime string. -
find_three_largest(dict_of_sizes)
Returns a string showing the three largest items in the dictionary.
Just clone the repo:
git clone https://github.com/Ade20boss/FileProfiler
cd FileProfilerMake sure you're using Python 3.8+
directory_audit("C:\\path\\to\\your\\folder")Output will include categorized stats for all supported file types.
| Category | Extensions |
|---|---|
| Images | .jpg, .jpeg, .png |
| Documents | .pdf, .docx, .xlsx, .pptx |
| Music | .mp3, .wav, .flac |
| Videos | .mp4, .mkv, .mov, .wmv, .m4v |
| Code/Scripts | .py, .js, .cpp, .java |
| Archives | .zip, .tar.gz, .tar.bz2 |
| Others | Everything else |
The tool prints results directly to the console.
All timestamps are displayed in UTC.
File sizes are displayed in megabytes (MB), rounded to 5 decimal places.
π License
MIT License β feel free to use, modify, and level up your projects with it.
π€ Contributing
Pull requests are welcome. Improve file type detection, add new statistics, or contribute optimizations.
π¬ Author
Built by Daniel