Super Processor - the perfect wrapper for subprocess.run
Project description
SuperProcessor
the perfect wrapper for subprocess.run
Description
This module is meant to ease use of subprocess.run
,
minimizing and reducing all possible edge cases that
are prone to come with use of traditional run()
.
Goal
Write Shell commands in Python with ease!
Dependencies
None! This module relies on zero external dependencies,
making use of only the builtin module subprocess
.
Installation
Install either over Pypi with
pip3 install superprocessor
or over git-pip
pip3 install git+https://github.com/samocorp/superprocessor.git
Usage
This module is famous for the cmd
function, which has a signature of
cmd(* args: str) -> Tuple(stdout: str, stderr: Union[str, None])
As you can see, this function implements a Golang-style error handling, of returing both the std output and error of the command in the shell.
If no error is encountered, the second value of the returned tuple is of NoneType.
Importing and using the function is easy.
from superprocessor import cmd
cmd('mkdir -p ', NEW_DIR_P, \
'&& cd', NEW_DIR_P, \
'&& npm install')
License
This project is governed by the MIT License.
Copyright SamoCorp 2021.
All Rights Reserved.
Project details
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
Hashes for superprocessor-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d04e23b34f64211c7f62b823bd3ba1368a072ab46ca43bb61b7888842a07c720 |
|
MD5 | f2d6f825bf3bdd07406954253c9b7607 |
|
BLAKE2b-256 | ba18f263fd86d07be074f139a9652e729840bd5e2464e6cfc90411c4e275abd2 |