Metadata-Version: 2.4
Name: dustr
Version: 0.1.11
Classifier: Topic :: Utilities
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3
License-File: LICENSE.txt
Summary: Rust-based disk usage analyzer with histogram visualization
Author: Werner Van Geit
License-Expression: LGPL-3.0-or-later
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: homepage, https://github.com/wvangeit/dustr

# Dustr

Dustr is a Rust-based implementation of [duk](https://github.com/wvangeit/duk), a commandline utility that shows disk usage statistics in a directory with a histogram visualization.

## Introduction

Dustr provides the same functionality as duk but with a Rust backend for improved performance. It will show you a histogram of the disk usage in a directory:

```
Statistics of directory "." :

Size           In %   Histogram            Name
4.0 KB         1.39  #                    .gitignore
4.0 KB         1.39  #                    setup.py
4.0 KB         1.39  #                    README.md
12.0 KB        4.17  ##                   dist/
12.0 KB        4.17  ##                   dustr/
12.0 KB        4.17  ##                   build/
16.0 KB        5.56  ##                   duk.egg-info/
220.0 KB       76.39 ####################  .git/

Total directory size: 284.0 KB
```

## Installation

### From PyPI

```bash
pip install dustr
```

### From source

First, ensure you have Rust installed (see [rustup.rs](https://rustup.rs/)).

Then install maturin:

```bash
pip install maturin
```

Build and install the package:

```bash
cd dustr
maturin develop  # For development
# OR
maturin build --release  # To build a wheel
pip install target/wheels/dustr-*.whl
```

## Usage

```bash
dustr [OPTIONS] [DIRECTORY]
```

Options:

- `-i, --inodes`: Show inode count instead of size
- `-g, --nogrouping`: Don't use thousand separators (for inode mode)
- `-f, --noF`: Don't add file type indicators (`/` for directories, `@` for symlinks)
- `-j, --json`: Output results as JSON

### JSON output

```bash
dustr --json .
```

```json
{
  "directory": ".",
  "mode": "size",
  "entries": [
    { "name": ".gitignore", "value": 4, "percentage": 1.41 },
    { "name": ".git/", "value": 220, "percentage": 77.46 }
  ],
  "total": 284
}
```

## Differences from duk

- **Performance**: Rust backend with parallel directory traversal (jwalk + rayon)
- **Implementation**: Uses native Rust file system operations instead of calling `du` command
- **Progress**: Since the Rust implementation calculates all sizes in parallel, progress indication is less granular

## Requirements

- Python >= 3.9
- Rust toolchain (for building from source)

## License

LGPL-3.0-or-later

