Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pygnuutils

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pygnuutils

A python implementation for GNU utils

  • 0.1.1
  • PyPI
  • Socket score

Maintainers
1

Python application Pypi version

Description

pygnuutils is a pure python implementation for GNU utils.

Installation

Install the last released version using pip:

python3 -m pip install --user -U pygnuutils

Or install the latest version from sources:

git clone git@github.com:matan1008/pygnuutils.git
cd pygnuutils
python3 -m pip install --user -U -e .

Usage

CLI

You can run commands by using pygnuutils prefix. For example, in order to list /tmp/foo you can run:

pygnuutils ls -lRh /tmp/foo

Python

To use pygnuutils you can write the following:

from pygnuutils.ls import Ls

ls = Ls()
ls('/tmp', all_=True)

Perhaps the best reason to use this library instead of gnu is the dependency injection ability.

For example, in order to print a message each time a symlink is resolved:

import os

from pygnuutils.ls import Ls, LsStub


class ReadlinkWatch(LsStub):
    def readlink(self, path, dir_fd=None):
        print(f'Resolving {path}...')
        return os.readlink(path, dir_fd=dir_fd)


ls = Ls(stub=ReadlinkWatch())
ls('/tmp', all_=True, long=True)

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc