Metadata-Version: 2.4
Name: shoper
Version: 1.4.2
Summary: Simple shell operator module
Author-email: Daichi Narushima <dceoy@users.noreply.github.com>
Maintainer-email: Daichi Narushima <dceoy@users.noreply.github.com>
License-Expression: MIT
Project-URL: Repository, https://github.com/dceoy/shoper.git
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Shells
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

shoper
======

Simple shell operator module for Python

[![Test](https://github.com/dceoy/shoper/actions/workflows/test.yml/badge.svg)](https://github.com/dceoy/shoper/actions/workflows/test.yml)
[![Upload Python Package](https://github.com/dceoy/shoper/actions/workflows/python-package-release-on-pypi-and-github.yml/badge.svg)](https://github.com/dceoy/shoper/actions/workflows/python-package-release-on-pypi-and-github.yml)

Installation
------------

```sh
$ pip install -U shoper
```

Example
-------

List directory contents with `ls`.

```py
from shoper import ShellOperator

sh = ShellOperator()
sh.run('ls -l')
```

Write and sort random numbers.

```py
from shoper import ShellOperator

sh = ShellOperator()
sh.run(
    args=[
        'echo ${RANDOM} | tee random0.txt',
        'echo ${RANDOM} | tee random1.txt',
        'echo ${RANDOM} | tee random2.txt'
    ],
    output_files_or_dirs=['random0.txt', 'random1.txt', 'random2.txt']
)
sh.run(
    args='sort random[012].txt | tee sorted.txt',
    input_files_or_dirs=['random0.txt', 'random1.txt', 'random2.txt'],
    output_files_or_dirs='sorted.txt'
)
```
