A modern, type-annotated Python implementation of the Unix ls command with beautiful Rich formatting and color-coded file types
Project description
richpyls - A Python Implementation of the Unix ls Command
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
| Metric | Status |
|---|---|
| Test Coverage | |
| Type Coverage | |
| Code Quality | |
| Security Scan | |
| Documentation |
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
-toption - ๐ Hidden Files: Show hidden files (starting with
.) with the-aoption using ๐ซฃ emoji - ๐ Size Sorting: Show top N largest files/directories sorted by size with the
-soption - ๐ 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
Development & Contributing
Contributions are welcome! Here's how you can set up the development environment and contribute:
Setup
-
Fork the repository or clone directly:
git clone https://github.com/lpozo/richpyls.git cd richpyls
-
Reproduce the development environment:
uv sync --dev
-
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
-
Create a feature branch:
git checkout -b feature/amazing-feature -
Make your changes: Implement your feature or bug fix
-
Add tests: Ensure your changes are well-tested
-
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
-
Commit your changes:
git commit -m 'Add amazing feature' -
Push to the branch:
git push origin feature/amazing-feature -
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
- GitHub: @lpozo
โญ If you found this project helpful, please give it a star!
Acknowledgments
- Inspired by the Unix
lscommand - 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file richpyls-0.1.3.tar.gz.
File metadata
- Download URL: richpyls-0.1.3.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27a68b126ae4007cb757d43b4573331c566a3a073bcf40302428f3ba5475cc13
|
|
| MD5 |
e5d67a3a6df21a1880dfddb6690d0c08
|
|
| BLAKE2b-256 |
3fd3bda5832a54dd2ae4b10665d7e3459c1d73da6c2a10e3b12fe7c64d271332
|
Provenance
The following attestation bundles were made for richpyls-0.1.3.tar.gz:
Publisher:
publish.yml on lpozo/richpyls
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
richpyls-0.1.3.tar.gz -
Subject digest:
27a68b126ae4007cb757d43b4573331c566a3a073bcf40302428f3ba5475cc13 - Sigstore transparency entry: 272621807
- Sigstore integration time:
-
Permalink:
lpozo/richpyls@cc115fe725ecbbb25cb346afe44fbbd1909f7c8e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lpozo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cc115fe725ecbbb25cb346afe44fbbd1909f7c8e -
Trigger Event:
push
-
Statement type:
File details
Details for the file richpyls-0.1.3-py3-none-any.whl.
File metadata
- Download URL: richpyls-0.1.3-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84fdef27bd27c1ba0875037698f3ba230cdc74c7481927ca52bd7d8268c4a23e
|
|
| MD5 |
e013d6ee8b66b97f597f5abf65982ed1
|
|
| BLAKE2b-256 |
4a009192be6248bb27d29212f6447b504587b2b6a8fe632a8e450eb598e21127
|
Provenance
The following attestation bundles were made for richpyls-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on lpozo/richpyls
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
richpyls-0.1.3-py3-none-any.whl -
Subject digest:
84fdef27bd27c1ba0875037698f3ba230cdc74c7481927ca52bd7d8268c4a23e - Sigstore transparency entry: 272621808
- Sigstore integration time:
-
Permalink:
lpozo/richpyls@cc115fe725ecbbb25cb346afe44fbbd1909f7c8e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lpozo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cc115fe725ecbbb25cb346afe44fbbd1909f7c8e -
Trigger Event:
push
-
Statement type: