Skip to content

Maetel/Diskraphic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diskraphic

  • Analyzes your file system and visualizes it into a graphical form
  • This toy project is my 2nd python tutorial

Initial try - Graphwise

Let's begin with the simplest style.
The longer(the darker), the larger file size.
FYI : Result image directory is excluded from the analysis

  • Grayscale - Background intensity is the mean file size.
  • RGB - File size as Red, file name as Green, path as Blue. Of similar color means they're near in path.
  • DNA-ish feature added. You can find it out at visualize().
    DNA DNA Graphwise Graphwise

Dependency

Python3.8 (possibly lower versions of Python3 will fit)
OpenCV (possibly any version will fit, used for general image processing)
Pillow (possibly any version will fit, used to export gif)

Example

  • Graphwise - shown as above

    from Visualizer import Graphwise
    from Navigator import Navigator
    
    path = "" #if not designated, set it to current path
    viz = Graphwise()
    nav = Navigator(path)
    while viz.update(nav.read_next()):
       pass
    stat = viz.stat()
    result_image = viz.visualize()
  • Simplest - returns a list, filled with all the materials

    from Visualizer import Simplest
    from Navigator import Navigator
    
    path = "" #if not designated, set it to current path
    viz = Simplest()
    nav = Navigator(path)
    while viz.update(nav.read_next()):
       pass
    result_list = viz.visualize()

These are the brainstorming materials

Core logic
  1. A file is placed under a certain path.
  2. A path is a child of another path, unless it's the root directory
  3. A file has following attributes
    • name
    • type (extension)
    • size
    • some attributes like date created/modified, author
  4. A file may require permission to even access
  5. Directory structure is in a tree form.
  6. There will be one or more drives, and each drive will become a root.
  7. How to turn file attributes into color channels and its position related to previous files is the key
overall
  1. an image can be in grayscale (8bytes) or can be in rgb (24bytes) or rgba(32bytes)
    • how to visualize file attributes and directory structure is the main key
  2. Used
  3. The final image must be updatable for each iteration. With this logic, I can extract the result each iteration, so that I can visualize it in a video form. Here is the pseudo code for the logic;
while True:
  info = read_next_file()
  if info:
    update_result(info)
  else:
    break
Just ideas
  1. The result can be a tree (or trees for multiple drives), growing as the iteration goes on. Inaccessible dirs and files will be the root, it being the mass of inaccessible files' size compared to that of the accessibles.
    Tree
  2. The result can be a disk (such traditional huh).
    Sonic wave
    Disk usage
  3. Or some kind of fractal pattern will be cool
    Fractal
  4. Recursive design. Just google it. There are tons
    Recursive
  5. Let's just begin from a small step. Don't impress myself too much from the beginning. Just do it.

About

analyzes your file system and make it into graphics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages