pygnuutils
A python implementation for GNU utils
What it is and what it does
pygnuutils is a pure Python reimplementation of GNU utility commands, allowing you to call familiar tools like `ls` either from the command line (via a `pygnuutils` prefix) or directly from Python code. The main appeal is its support for dependency injection—you can subclass the utility's internal stub to intercept and customize behavior (like logging symlink resolution) without modifying the core implementation.
The package depends only on click for CLI handling and supports Python 3.7 through 3.11. It is marked as Production/Stable but has not been updated since May 2023, making it suitable for stable, low-change use cases but not for active development where you need ongoing maintenance or new GNU utility additions.
Use it for:
- Call GNU utilities from Python code without shelling out, using ls() with custom options
- Inject custom behavior into file operations (e.g., logging, filtering, or mocking symlink resolution)
- Build CLI tools that wrap or extend GNU utilities with Python-specific logic via the click integration
- Test code that depends on GNU utilities by mocking their behavior through dependency injection
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides pure Python implementations of GNU utility commands (like `ls`) that can be used as CLI tools or imported as libraries with dependency injection support.
Yes, if you need a stable, lightweight Python wrapper around GNU utilities with dependency injection for testing or customization. The low install friction and lack of security vulnerabilities support this. However, the dormant maintenance status (no updates since May 2023) means you should verify that the utilities you need are already implemented and that you're comfortable with no active support for new features or GNU utility additions.
Install
pygnuutils on PyPI
pip
pip install pygnuutilsuv
uv add pygnuutilspoetry
poetry add pygnuutilsInstalling pygnuutils
Before you install
Low friction install with a single runtime dependency (click). Dormant maintenance since May 2023 with no recent commits, though the repository remains active and unarchived.
License in practice
Licensed under GPLv3+, a copyleft license requiring that any distributed modifications or derivative works also be released under GPLv3+. Suitable for open-source projects but restricts use in proprietary software.
Quickstart
pip install pygnuutils
from pygnuutils.ls import Ls
ls = Ls()
ls('/tmp', all_=True)
Verify before relying
- Which GNU utilities beyond ls are currently implemented in this version
- Whether the dependency injection pattern is documented with examples beyond the readlink use case
- Current test coverage and whether the implementation handles all standard GNU utility flags
Package facts
| License | GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license… (full text in the JSON record) (copyleft) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — click |
| Maintenance | dormant — 1,190 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 315,514/month — #7,684 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pygnuutils-0.1.1-py3-none-any.whl
Keywords: gnu, cli, coreutils
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
bashProvides a Python wrapper for running bash…
copyleft · top 15,000 on PyPI
lamin_utilsProvides utility functions and helpers for…
permissive · top 15,000 on PyPI
etilsA modular collection of utility submodules for…
permissive · top 5,000 on PyPI
sensai-utilsProvides general-purpose utility classes…
permissive · top 15,000 on PyPI
punqPunq is a dependency injection container for…
unclear · top 15,000 on PyPI
shellescapeProvides a `quote()` function that…
permissive · top 5,000 on PyPI
runezA zero-dependency utility library providing…
permissive · top 5,000 on PyPI
setuptools-golangA setuptools extension that builds CPython…
permissive · top 5,000 on PyPI
jaraco.windowsProvides a pure-Python interface to Windows…
permissive · top 15,000 on PyPI
bashkitBashkit is a sandboxed bash interpreter for…
permissive · top 15,000 on PyPI