An open API service indexing awesome lists of open source software.

https://github.com/junaid433/py-coreutils

The Modern, Cross-Platform Python Rewrite of GNU Coreutils
https://github.com/junaid433/py-coreutils

cli command-line coreutils cross-platform developer-tools gnu hacktoberfest linux open-source python scripting shell sysadmin tools utilities

Last synced: 4 months ago
JSON representation

The Modern, Cross-Platform Python Rewrite of GNU Coreutils

Awesome Lists containing this project

README

          

# 🐍✨ PY-CoreUtils

**The Modern, Cross-Platform Python Port of GNU Coreutils**

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Python Version](https://img.shields.io/badge/python-3.6%2B-blue.svg)](https://www.python.org/)
[![CI](https://github.com/Junaid433/PY-CoreUtils/actions/workflows/python-tests.yml/badge.svg)](https://github.com/Junaid433/PY-CoreUtils/actions)
[![Open Issues](https://img.shields.io/github/issues/Junaid433/PY-CoreUtils?color=orange)](https://github.com/Junaid433/PY-CoreUtils/issues)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](CONTRIBUTING.md)

---

> **✨ Unix CLI power, Pythonic flexibility. Run coreutils anywhere.**

---

## 🌟 Why PY-CoreUtils?

- πŸ–₯️ **Cross-platform**: Linux, macOS, Windows β€” no C toolchain needed.
- 🧩 **Drop-in CLI tools**: Familiar commands, same flags, same output.
- 🐍 **Pure Python**: No dependencies, hackable, readable, and extendable.
- πŸ’‘ **Great for scripting, teaching, and dev environments**.
- πŸ”₯ **Modern code, modern vibes**.

---

## πŸ› οΈ Quick Start

```bash
# Clone and run any tool instantly!
git clone https://github.com/Junaid433/PY-CoreUtils.git
cd PY-CoreUtils
python src/mkdir.py --help
python src/rm.py --help
python src/date.py --help
python src/nproc.py --help
python src/hostid.py --help
python src/hostname.py --help
python src/id.py --help
python src/users.py --help
python src/uptime.py --help
python src/yes.py --help
```

---

## πŸ§‘β€πŸ’» Coreutils, Python Style

| Command | Status | | Command | Status |
| ------------ | ------ |--| ------------ | ------ |
| `basename` | βœ… | | `cat` | βœ… |
| `chcon` | βœ… | | `chmod` | ⏳ |
| `date` | βœ… | | `echo` | βœ… |
| `hostid` | βœ… | | `hostname` | βœ… |
| `id` | βœ… | | `kill` | βœ… |
| `mkdir` | βœ… | | `nproc` | βœ… |
| `pwd` | βœ… | | `rm` | βœ… |
| `sleep` | βœ… | | `tee` | βœ… |
| `touch` | βœ… | | `uptime` | βœ… |
| `users` | βœ… | | `whoami` | βœ… |
| `yes` | βœ… | | `chgrp` | ⏳ |
| `chown` | ⏳ | | `chroot` | ⏳ |
| `cksum` | ⏳ | | `comm` | ⏳ |
| `cp` | ⏳ | | `csplit` | ⏳ |
| `cut` | ⏳ | | `dd` | ⏳ |
| `df` | ⏳ | | `dir` | ⏳ |
| `dircolors` | ⏳ | | `dirname` | ⏳ |
| `du` | ⏳ | | `env` | ⏳ |
| `expand` | ⏳ | | `expr` | ⏳ |
| `factor` | ⏳ | | `false` | ⏳ |
| `fmt` | ⏳ | | `fold` | ⏳ |
| `groups` | ⏳ | | `head` | ⏳ |
| `install` | ⏳ | | `join` | ⏳ |
| `link` | ⏳ | | `ln` | ⏳ |
| `logname` | ⏳ | | `ls` | ⏳ |
| `md5sum` | ⏳ | | `mkfifo` | ⏳ |
| `mknod` | ⏳ | | `mktemp` | ⏳ |
| `mv` | ⏳ | | `nice` | ⏳ |
| `nl` | ⏳ | | `nohup` | ⏳ |
| `numfmt` | ⏳ | | `od` | ⏳ |
| `paste` | ⏳ | | `pathchk` | ⏳ |
| `pinky` | ⏳ | | `pr` | ⏳ |
| `printenv` | ⏳ | | `printf` | ⏳ |
| `ptx` | ⏳ | | `readlink` | ⏳ |
| `realpath` | ⏳ | | `rmdir` | ⏳ |
| `runcon` | ⏳ | | `seq` | ⏳ |
| `sha1sum` | ⏳ | | `sha224sum` | ⏳ |
| `sha256sum` | ⏳ | | `sha384sum` | ⏳ |
| `sha512sum` | ⏳ | | `shred` | ⏳ |
| `shuf` | ⏳ | | `sort` | ⏳ |
| `split` | ⏳ | | `stat` | ⏳ |
| `stdbuf` | ⏳ | | `stty` | ⏳ |
| `sum` | ⏳ | | `sync` | ⏳ |
| `tac` | ⏳ | | `tail` | ⏳ |
| `tee` | βœ… | | `test` | ⏳ |
| `timeout` | ⏳ | | `tr` | ⏳ |
| `true` | ⏳ | | `tsort` | ⏳ |
| `tty` | ⏳ | | `uname` | ⏳ |
| `unexpand` | ⏳ | | `uniq` | ⏳ |
| `unlink` | ⏳ | | `vdir` | ⏳ |
| `wc` | ⏳ | | `who` | ⏳ |

---

🌈 CLI Demos (click to expand)

```bash
$ python src/rm.py -rf build/
$ python src/date.py ">'+%Y-%m-%d %H:%M:%S'
$ python src/mkdir.py -p src/utils
$ python src/pwd.py
$ python src/basename.py /usr/bin/python3
$ python src/echo.py -e "Hello\nWorld!"
$ python src/nproc.py --all
$ python src/nproc.py --ignore=2
$ python src/sleep.py 2m
$ python src/kill.py -l
$ python src/kill.py -s HUP 5678
$ python src/hostid.py
$ python src/hostname.py
$ python src/id.py
$ python src/users.py
$ python src/uptime.py
$ python src/yes.py "y" | head -n 5
```

---

## ✨ What Makes This Cool?

- **Full GNU-style CLI**: All major flags, help/version, error codes.
- **Logical/Physical path handling**: `pwd` supports -L/-P, symlinks, POSIXLY_CORRECT.
- **Date/time power**: `date` supports parsing, formatting, reference file, UTC, batch, and more.
- **Safe & robust**: `rm` has interactive, force, and recursive modes.
- **No C, no build, no nonsense**: Just Python.
- **100% pytest coverage** and [GitHub Actions](https://github.com/Junaid433/PY-CoreUtils/actions) CI.

---

## πŸ“š [Full Usage, Features & Architecture β†’](docs/usage.md)

- [Usage Examples](docs/usage.md)
- [Features](docs/features.md)
- [Project Architecture](docs/architecture.md)

---

## πŸ—ΊοΈ Roadmap & Vision

- [ ] More GNU tools: `ls`, `cp`, `mv`, `cat`, `head`, `tail`, `chmod`, ...
- [ ] Windows/macOS-specific improvements
- [ ] More docs, more examples, more tests
- [ ] Community-driven features (your ideas here!)

---

## πŸ’¬ Get Involved!

> **We welcome all contributorsβ€”new and experienced!**
>
> - [Contributing Guide](CONTRIBUTING.md)
> - [Code of Conduct](CODE_OF_CONDUCT.md)
> - [Security Policy](SECURITY.md)
> - [Open Issues](https://github.com/Junaid433/PY-CoreUtils/issues)
> - [Discussions](https://github.com/Junaid433/PY-CoreUtils/discussions)

Star ⭐ the repo, share it, and help us build the best Python-powered coreutils!

---

## πŸ’‘ Did you know?

> You can use PY-CoreUtils as a teaching tool, a scripting Swiss Army knife, or even as a base for your own Python CLI projects. Fork it, hack it, and make it yours!

---

## πŸ“„ License

[GNU GPL v3 or later](https://www.gnu.org/licenses/gpl-3.0.html)

---

πŸ’‘ Hack, learn, and build with Python-powered coreutils!