Skip to main content

Display the output of "du" in a window.

Project description

pyxdu

Pyxdu — display the output of "du" disk usage tool in a window.

Pyxdu is a Python port of "xdu", an X window disk usage utility. Pyxdu is a retro tool that tries to follow the style of 1990s in its visual design.

PyPI PyPI - Downloads

Example

Run "du" to show disk usage for directory /usr in megabytes, pipe the output to "pyxdu", sort directories in numerical order:

du -m /usr | pyxdu -n

Dark theme

Installation

You can install pyxdu on Python 3.7 or newer using pip:

pip install pyxdu

Description

Pyxdu is a program for displaying a graphical tree of disk space utilization as reported by the UNIX utility "du". The user can navigate through the tree structure and change the order of the displayed information. The window is divided up into several columns, each of which is one level deeper in the directory hierarchy (from left to right). Boxes are drawn for each directory. The amount of vertical space occupied by each box is directly proportional to the amount of disk space consumed by it and all of its children. The name of each directory and the amount of data are displayed provided that there is enough space within its box. Any space at the "bottom" of a box not covered by its children to the right represents the space consumed by files in that directory (as opposed to space from its children).

There are several command line options available.

  • -h --help
    • Show help message.
  • -s
    • Don't display sizes. (not supported yet)
  • -a
    • Sort in alphabetical order.
  • -n
    • Sort in numerical order (the largest first).
  • -r
    • Reverse sense of sort (e.g. -rn means the smallest first).
  • -c <num>
    • Display <num> columns [default: 6].
  • --foreground <color>
    • Determines the color of the text and lines. (not supported yet)
  • --background <color>
    • Determines the color of the background. (not supported yet)
  • --dump <file>
    • Dump tree as JSON for debugging.
  • --traceback
    • Print traceback on exceptions.

Mouse Actions

The user can move up or down the tree by clicking the left mouse on a directory box. If the left most box is selected, the display will move up one level (assuming you are not already at the root). If any other box is selected, it will be placed against the left edge of the window, and the display will be rescaled appropriately. At any time the middle mouse will bring you back to the root. Clicking the right mouse will exit the program. (not supported yet)

Keystrokes

  • 1-9, 0
    • Sets the number of columns in the display (0 = 10).
  • a
    • Alphabetical sort.
  • n
    • Numerical sort (the largest first).
  • f
    • First-in-first-out sort (this is the order the data was read into the program).
  • l
    • Last-in-first-out sort.
  • r
    • Reverse sense of sort.
  • s
    • Toggle size display. (not supported yet)
  • h
    • Display a popup help window. (not supported yet)
  • i
    • Display information about the current root node to standard out. The first line shows the path within the tree, the total size from this node on down, and the percentage that total represents of all the data given to xdu. Subsequent lines show the size and name information for all children of this node in the order they are currently sorted in. This allows tiny directories to be seen that otherwise could not be labeled on the display, and also allows for cutting and pasting of the information. (not supported yet)
  • /
    • Goto the root.
  • q, Escape
    • Exit the program.

Development

Development requirements:

Set up a development environment:

git clone https://github.com/vlasovskikh/pyxdu.git
cd pyxdu
poetry install
poetry run pyxdu --help
du | poetry run pyxdu

Authors

Credits

The original tool xdu was released by Phil Dykstra on 1991-09-04. The most recent version xdu 3.0 was released on 1994-06-05.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyxdu-0.3.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

pyxdu-0.3.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file pyxdu-0.3.0.tar.gz.

File metadata

  • Download URL: pyxdu-0.3.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for pyxdu-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1be3a4bcdb35abd2694228f0a95c5d9b4baca6700bf018bd347b29d1d2a88efe
MD5 10906bd81c4520a2790639f5bec67b6f
BLAKE2b-256 25eef1dca8bb4562503229082210f6ec1d54b1732d003067b3fda1a680f039db

See more details on using hashes here.

File details

Details for the file pyxdu-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pyxdu-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for pyxdu-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e5fae93ef950518f8dc2782445b4caf40c4d356a863b15a967fb053f67ef233
MD5 74f845639d7e7c9ba161f389fd6b2643
BLAKE2b-256 1cfd5314cb32539b759e8a0d4030420bea707a8954dffb8702b5b4ad7cb898b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page