Skip to main content

Directory summary tool

Project description

📂 lsum

PyPI version Python Version License: MIT Code Style: Black

lsum (List Summary) is a high-performance, visually rich CLI directory analysis tool that transforms standard file listings into actionable intelligence.


⚡ TL;DR

lsum is ls on steroids. It doesn't just list files; it categorizes, counts, and visualizes your directory's distribution by MIME types, extensions, and metadata—all while respecting your .gitignore rules.


🤔 Why lsum?

Standard tools like ls or tree are great for finding files, but they fail to answer higher-level questions about your workspace. lsum was built to fill that gap:

  • Audit Your Assets: Instantly see how many gigabytes of images vs. text files you have.
  • Visualize Structure: Group files into elegant, color-coded panels based on their actual content (MIME) rather than just extensions.
  • Clean Analysis: Use the --gitignore flag to strip out node_modules, build artifacts, and logs, focusing only on the code that matters.
  • Recursive Intelligence: Understand the composition of entire project trees in a single, formatted view.

[!NOTE] lsum is under active development


🚀 Installation

Pre-Requisites

This package depends on python-magic, which requires libmagic.

If not installed already, install it using -

Linux
sudo apt install libmagic1
macOS
brew install libmagic
Windows (you don't need to install it manually, it is handled in the dependencies)

Install via:

pip install python-magic-bin

📦 From PyPI (Recommended)

Install using uv for the best experience:

uv tool install lsum

Or with standard pip:

pip install lsum

🛠️ Building From Source

Perfect for developers who want the latest features:

# Clone the repository
git clone https://github.com/Debajyati/lsum.git
cd lsum

# Install dependencies and build
uv pip install -e .

🛠️ Usage Examples

1. Basic Listing

A clean, tabular view of your current directory:

lsum

2. Group by MIME Type (with Icons)

See your files grouped by their actual content type (e.g., Image, Video, Text):

lsum --group

3. Respect Gitignore

Exclude build artifacts and ignored files for a "clean" summary:

lsum . --gitignore --count

4. Recursive Extension Summary

Analyze every file in your project tree, grouped by extension:

lsum . --recursive --group-extension

5. Advanced Sorting & Filtering

Find all .txt files and sort them by size:

lsum --filter-extension .txt --sort size

⌨️ CLI Options

Option Shorthand Description
--count -c Count files/directories in groups or total.
--group -g Group files by MIME type.
--group-extension -ge Group files by file extension.
--gitignore -gi Respect .gitignore rules (excludes ignored files).
--recursive -r Perform operations on all subdirectories.
--sort -s Sort by name, size, or date.
--filter -f Filter by a specific MIME type (e.g., image/jpeg).

📄 License

Distributed under the MIT License. See LICENSE for more information.


Built with ❤️ using Python and Rich.

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

lsum-0.1.3.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lsum-0.1.3-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file lsum-0.1.3.tar.gz.

File metadata

  • Download URL: lsum-0.1.3.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Void","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lsum-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b2542def5e43efef3f6a546aa7951b347893cdb976972c786ddecf9b8132fdac
MD5 470f5d8cc79a57fb1242fbccb2bb47b1
BLAKE2b-256 7af7bf1dc41bb5dd05be1a3af22d59fb1cfa626659a5c2af3ae4c3843f441877

See more details on using hashes here.

File details

Details for the file lsum-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: lsum-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Void","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lsum-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cccdde297f8e9203e5df22b6f2a1070822d758fb372da7bca560f7ea8c0d0571
MD5 3023f0bfcbf39ad84221f8427fed90ce
BLAKE2b-256 60ed7eb9ed35c71d93b1b98c0ca180419e54393bb5eb1d6bc340081fafd30f29

See more details on using hashes here.

Supported by

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