• Stars
    star
    105
  • Rank 328,196 (Top 7 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 13 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Command-line disk space usage visualization utility
PyPI - Python Version unit tests pre-commit

What is duviz?

duviz is a (Python 3) command-line tool to visualize disk space usage.

It's like the plethora of desktop applications and widgets (e.g. Filelight, DaisyDisk, WinDirStat, JDiskReport, TreeSize, SpaceSniffer, ...), but instead of a fancy GUI with animated pie charts and shaded boxes you get a funky "ASCII art style hierarchical tree of bars" in your shell. If that didn't make a lot of sense to you, look at this example of this /opt folder:

$ duviz /opt
________________________________________________________________________________
[                                     /opt                                     ]
[____________________________________3.30GB____________________________________]
[                                    local                                     ]
[____________________________________3.30GB____________________________________]
[              var              ][        lib         ][ share  ][Libr][lib][]|
[_____________1.36GB____________][______925.47MB______][411.37MB][231.][222][]|
[           macports           ]|[gcc][gcc4][]|||      [][]||||||[Fra]|[gc] |
[____________1.36GB____________]|[250][226.][]|||      [][]||||||[231]|[21] |
[    software    ][distfile][]| |           ||  |      | ||||||||[Pyt] [x8]
[____785.31MB____][421.56MB][]| |           ||  |      | ||||||||[231] [21]
[gc][][]||||||||||||||||||||[]               |            ||| |  [Ve]  ||[]
[17][][]||||||||||||||||||||[]               |            ||| |  [23]  ||[]

Features

  • Basically it consists of just one Python 3 script duviz.py. No installation required: put it where you want it. Use it how you want it.
  • Only uses standard library and just depends on du and ls utilities, which are available out of the box on a typical Unix platform (Linux, macOS)
  • Speed. No need to wait for a GUI tool to get up and running, let alone scanning your disk. The hard work is done by du (or ls), which run an C-speed.
  • Progress reporting while you wait. Be hypnotized!
  • Detects your terminal width for maximum visualization pleasure.
  • Not only supports "disk usage" based on file size, but also allows to count files (inode count mode) or give a size breakdown of ZIP or tar files.
  • Option to use terminal colors for the boxes instead of ASCII art

Installation

Pip based

duviz can be installed with pip in a desired virtual environment:

pip install duviz

which will install a duviz command line utility in your environment.

If you already have pipx on your toolbelt, you might prefer to install duviz in an automatically managed, isolated environment with pipx install duviz.

With Homebrew

duviz can also be installed with Homebrew through the soxofaan/duviz tap:

brew install soxofaan/duviz/duviz
No installation

The file duviz.py is also designed to be usable as a standalone Python script, without having to install it. Download duviz.py and just run it:

python path/to/duviz.py

Python 2 Support

duviz was originally (2009) a Python 2 script, and started supporting Python 3 around 2016. With the end of life of Python 2 nearing in 2019, support for Python 2 was dropped. The Python 2 compatible version can be found in the py2-compatible branch (last release: 1.1.1).

Usage

If you run duviz without arguments, it will render the disk usage of the current working folder. If you specify one or more directories, it will render the usage of those directories, how intuitive is that!

Instead of size in bytes, you can also get inode usage: just use the option --inodes (or -i in short).

If you directly pass duviz a ZIP or tar file, it will visualize the size breakdown of the file tree in the ZIP/tar file. In case of ZIP files, the compressed size will be shown by default (option --unzip-size will toggle showing of decompressed size). For tar files, only the decompressed size is available.

Run it with option --help for more options.

More Repositories

1

scrollocue

Simple autocue/teleprompter jQuery plugin
HTML
135
star
2

dahuffman

Python Module for Huffman Encoding and Decoding
Python
62
star
3

d3-plugin-captain-sankey

Friendly (subtree) fork of the "sankey" plugin from https://github.com/d3/d3-plugins
JavaScript
41
star
4

jupyter-playground

Random collection of Jupyter notebooks
Jupyter Notebook
31
star
5

git-svn-mirroring

Helper scripts to set up git to svn mirroring
Shell
18
star
6

asynchronousfilereader

Simple thread based asynchronous file reader for Python
Python
10
star
7

midjourney-archiver

Command line tool to download your whole Midjourney history (images + full prompts)
Python
6
star
8

epsel

Ensure PySpark Executor Logging
Python
5
star
9

CssDeadwood

Tool to search for unused CSS selectors.
Python
4
star
10

sl-tools

Collection of some small tools and utilities
Python
3
star
11

xhpast

Abstract Syntax Tree parser for PHP
C++
3
star
12

meatspin

Meat That Spins!
HTML
2
star
13

drupal-flickr-dev

Some own developement branches for the Flickr module of Drupal
2
star
14

git-update-hook-nitty-committy

git update hook to check commit messages against a histogram
Python
2
star
15

geshifilter-dev

Development of the GeSHi filter module for Drupal
PHP
2
star
16

jquery-konami

jQuery Konami plugin
JavaScript
1
star
17

drupal-captcha_pack-dev

Development of the CAPTCHA Pack module for Drupal
PHP
1
star
18

emailboard

Simple email testing utility script that ties together a SMTP server to receive emails and a HTTP server to display them
Python
1
star
19

git-svn-problem-scenario

Problem scenario of git-svn usage
Shell
1
star
20

here-this

here-this is a simple wrapper script around tmux to easily launch a long running command in a background tmux session
Python
1
star
21

duplin

Duplicate file searching and hardlinking
Python
1
star
22

php-mollom

PHP class to interact with mollom.com web service
PHP
1
star
23

your-unbirthday

It's Your Unbirthday!
JavaScript
1
star
24

d3-plugin-sanchord

D3 plugin for visualising flows in a network
JavaScript
1
star