Skip to content

About

A simple Python CLI tool for scanning directories and analyzing file types.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

File Intelligence 📂

A simple Python CLI tool that scans a directory, lists its files, counts file types, and displays file-type statistics sorted by frequency.

Features

  • Scan a user-specified directory
  • Validate that the path exists
  • Validate that the path is a directory
  • List files with numbered output
  • Count total files
  • Detect file extensions
  • Handle files without extensions
  • Count files by type
  • Sort file types by frequency

Example

Enter a folder path: /home/saeed/Documents

Please wait for scanning directory: /home/saeed/Documents

1. report.pdf
2. photo.jpg
3. data.csv
4. README
5. script.py
6. another.jpg

Total files: 6

File types:

1. .jpg = 2
2. .pdf = 1
3. .csv = 1
4. No extension = 1
5. .py = 1

Technologies

  • Python
  • pathlib
  • dictionaries
  • loops and conditionals
  • sorted()
  • lambda
  • enumerate()

What I Practiced

This project was built as a practical Python exercise to practice working with files and directories.

Through this project I practiced:

  • Python modules and imports
  • pathlib.Path
  • File and directory handling
  • Dictionary-based counting
  • Iteration with for
  • enumerate()
  • Sorting with sorted()
  • Using lambda with key=
  • Basic input validation
  • Writing readable Python code

How to Run

Make sure Python is installed, then run:

python3 main.py

Enter the path of the directory you want to scan.

Project Status

Completed ✅

This is a small learning project and will be kept intentionally simple. More advanced features may be added in future projects as I improve my Python skills.

About

A simple Python CLI tool for scanning directories and analyzing file types.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages