Skip to main content

richpyls - A Python Implementation of the Unix ls Command

CI/CD Pipeline Python Version License: MIT

Code Style: Ruff Type Checked: mypy Security: Bandit Pre-commit

A modern, type-annotated Python implementation of the Unix ls command with beautiful Rich formatting, color-coded file types, and support for long format listings and hidden files.

Quality Metrics

Code Size Repo Size Last Commit

Metric Status
Test Coverage Coverage Status
Type Coverage mypy
Code Quality Ruff
Security Scan Bandit
Documentation Docs

Features

  • 🎨 Rich Visual Output: Beautiful color-coded file types with emoji icons
  • 📁 Directory Listing: List files and directories in the current or specified path
  • 📄 Long Format: Display detailed file information in a professional table format
  • 🌳 Tree View: Display directories in a tree-like hierarchical format with the -t option
  • 🔍 Hidden Files: Show hidden files (starting with .) with the -a option using 🫣 emoji
  • 📊 Size Sorting: Show top N largest files/directories sorted by size with the -s option
  • 🏃 Fast Performance: Built with modern Python using pathlib for efficient path operations
  • 🎯 Type Safety: Fully type-annotated codebase with mypy validation
  • ✅ Well Tested: Comprehensive test suite with excellent coverage
  • 🐍 Modern Python: Uses Python 3.13+ features and best practices

File Type Icons

The Rich output includes beautiful emoji icons for different file types:

  • 🐍 Python files (.py, .pyx, .pyi)
  • ⚙️ Configuration files (.toml, .json, .yaml, .yml, .ini, .cfg, .conf)
  • 📄 Documentation files (.md, .rst, .txt, .doc, .docx, .pdf)
  • 📦 Archive files (.zip, .tar, .gz, .bz2, .xz, .7z, .rar)
  • 🖼️ Image files (.png, .jpg, .jpeg, .gif, .bmp, .svg, .ico)
  • 📁 Directories
  • ⚡ Executable files
  • 🔗 Symbolic links
  • 🫣 Hidden files (starting with .)

Installation

From PyPI (Recommended)

pip install richpyls

Once installed, you can use the richpyls command anywhere in your terminal.

From Source

Using uv (recommended)

# Clone the repository
git clone https://github.com/lpozo/richpyls.git
cd richpyls

# Install with uv
uv sync

# Run the application
uv run richpyls

Using pip

# Clone the repository
git clone https://github.com/lpozo/richpyls.git
cd richpyls

# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate  # On macOS/Linux
# or
.venv\Scripts\activate     # On Windows

# Install in editable mode
pip install -e .

# Run the application
richpyls

Usage

# List files in current directory
richpyls

# List files in specific directory
richpyls /path/to/directory

# List multiple files/directories
richpyls file1.txt directory1 file2.txt

Command Options

Option Description
-l Use long listing format (shows permissions, ownership, size, date in Rich table)
-a Show all files, including hidden files (starting with .) with 🫣 emoji
-t Display directories in a tree-like format with Rich styling
-s N Show top N files/directories sorted by size (descending) in a Rich table
-la Combine long format with showing hidden files
-tl Combine tree format with long listing
-ta Combine tree format with showing hidden files
-sa Combine size sorting with showing hidden files

Examples

# Basic listing with Rich icons and colors
richpyls
📄 README.md
⚙️ pyproject.toml
📁 src
📁 tests
📄 uv.lock

# Show hidden files with special emoji
richpyls -a
🫣 .git
🫣 .gitignore
🫣 .python-version
📁 .venv
📄 README.md
⚙️ pyproject.toml
📁 src
📁 tests
📄 uv.lock

# Tree format (shows directory structure with Rich styling)
richpyls -t
├── 📄 README.md
├── ⚙️ pyproject.toml
├── 📁 src
│   └── 📁 richpyls
│       ├── 🐍 __init__.py
│       └── 🐍 __main__.py
├── 📁 tests
│   ├── 🐍 __init__.py
│   └── 🐍 test_richpyls.py
└── 📄 uv.lock

# Tree format with long listing and Rich table
richpyls -tl src
└── drwxr-xr-x  5 user staff     160B Jul 11 18:34 📁 richpyls
    ├── drwxr-xr-x  4 user staff     128B Jul 11 18:34 📁 __pycache__
    │   ├── -rw-r--r--  1 user staff     622B Jul 11 18:34 📄 __init__.cpython-313.pyc
    │   └── -rw-r--r--  1 user staff   14.8KB Jul 11 18:34 📄 __main__.cpython-313.pyc
    ├── -rw-r--r--  1 user staff     452B Jul 11 18:34 🐍 __init__.py
    └── -rw-r--r--  1 user staff   12.1KB Jul 11 18:34 🐍 __main__.py

Technologies

Dependencies

  • Python 3.13+: Modern Python with type hints and advanced features
  • click: Command-line interface creation toolkit
  • rich: Rich text and beautiful formatting for the terminal

Development Dependencies

  • pytest: Testing framework for comprehensive test coverage
  • mypy: Static type checker for Python
  • ruff: Fast Python linter and formatter
  • bandit: Security vulnerability scanner
  • pre-commit: Git hooks for automated quality checks
  • uv: Fast Python package manager and resolver

Build & Deployment

Build Status Tests

Development & Contributing

Contributions are welcome! Here's how you can set up the development environment and contribute:

Setup

  1. Fork the repository or clone directly:

    git clone https://github.com/lpozo/richpyls.git
    cd richpyls
    
  2. Reproduce the development environment:

    uv sync --dev
    
  3. Set up pre-commit hooks for code quality:

    uv run pre-commit install
    

Running Tests

# Run all tests
uv run python -m pytest

# Run tests with verbose output
uv run python -m pytest -v

# Run tests with coverage
uv run python -m pytest --cov=richpyls

Type Checking

# Check types with mypy
uv run mypy src/richpyls/

# Check all Python files
uv run mypy .

Code Quality and Formatting

The project uses automated code quality tools:

# Format code with ruff
uv run ruff format .

# Lint code with ruff
uv run ruff check . --fix

# Security scan with bandit
uv run bandit -r src/

Pre-commit hooks automatically run quality checks on every commit.

Contributing Workflow

  1. Create a feature branch: git checkout -b feature/amazing-feature

  2. Make your changes: Implement your feature or bug fix

  3. Add tests: Ensure your changes are well-tested

  4. Run quality checks:

    uv run python -m pytest          # Run tests
    uv run mypy src/richpyls/        # Type check
    uv run ruff format .             # Format code
    uv run ruff check .              # Lint code
    
  5. Commit your changes: git commit -m 'Add amazing feature'

  6. Push to the branch: git push origin feature/amazing-feature

  7. Open a Pull Request

Development Guidelines

  • Follow PEP 8 style guidelines
  • Add type hints to all new code
  • Write tests for new functionality
  • Update documentation as needed
  • Ensure all tests pass before submitting

Project Standards

The project maintains high code quality through:

  • Type annotations: All functions and variables are type-annotated
  • Comprehensive tests: Excellent test coverage with edge cases
  • Clean architecture: Well-organized code with clear separation of concerns
  • Modern Python: Uses latest Python features and best practices
  • Rich UI: Beautiful terminal output with colors, icons, and professional formatting

Build & Publishing

For information about building and publishing the package, see BUILD_PUBLISHING.md.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

Leodanis Pozo Ramos


⭐ If you found this project helpful, please give it a star!

Acknowledgments

  • Inspired by the Unix ls command
  • Built with modern Python best practices
  • Thanks to the Python community for excellent tools and libraries
  • Special thanks to the Rich library for beautiful terminal output
  • Development assisted by GitHub Copilot Chat for enhanced productivity

Metadata

Release files for richpyls 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for richpyls 0.1.3
File Size Uploaded
richpyls-0.1.3.tar.gz 17.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for richpyls 0.1.3
File Interpreter ABI Platform
richpyls-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 28.4 kB

Release files / richpyls-0.1.3.tar.gz

Download URL richpyls-0.1.3.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
27a68b126ae4007cb757d43b4573331c566a3a073bcf40302428f3ba5475cc13
BLAKE2b-256 checksum
How to use checksums
3fd3bda5832a54dd2ae4b10665d7e3459c1d73da6c2a10e3b12fe7c64d271332
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 12, 2025.

Transparency log

Release files / richpyls-0.1.3-py3-none-any.whl

Download URL richpyls-0.1.3-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84fdef27bd27c1ba0875037698f3ba230cdc74c7481927ca52bd7d8268c4a23e
BLAKE2b-256 checksum
How to use checksums
4a009192be6248bb27d29212f6447b504587b2b6a8fe632a8e450eb598e21127
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 12, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page