Saravanan666/pypi-org huggingface dataset:
Package: shellish
shellishCommand-line/shell mashup frameworkAboutThis module combines the Python standard library modules argparse and cmd
to provide a unified way to make cli programs that can also be interactive
(when invoked in "shell" mode).The main benefit to using this package is streamlined command hierarchy when
you want to have rich set of subcommands along with a pretty powerful tab
completion layer that parses argparse arguments automagically.RequirementsPosix-like platformInstallationPyPi Stable Releasepip3 install shellishDevelopment Releasepython3 ./setup.py build
python3 ./setup.py installorpython3 ./setup.py developCompatibilityPython 3.5+ExamplesHello WorldDecoratorNesting (Subcommands)Alternate StylesTab CompletionAll Examples
Package: shellit
SHELLIT (shell it)shellit(shell it) is a package that will easily let you run shell commands from python and return your outputs.MotivationAs a developer I need to run shell commands and check the output and based on the outputI make the decision.
So to help developers who just want to run some shell commands with python here is the simple module :)
Just install and run shell commands.Setuppip install shellitfrom shellit import execute_cmd
outputfilename = 'shellit_output.txt'
cmd = "ls"
returncode, output = execute_cmd(cmd, shell=True, forced=False, outputfilename=outputfilename)

### Explaination ###

'''
    @param cmd(str) : cmd is a string which you want to execute with shell
    @param shell(bool) : shell is set to True to execute all commands in shell without any restrictions
    @param force(bool) : force to execute all commands even rm command.
    @param outputfilename(str) : name of the file in which output will be saved.
                              'shellit_output.txt' ($DEFAULT)  
    return 'returncode'(int) : 0 for successful.
                                any other num for unsuccessful command or if any error is thrown by the command.
            'output'(str) : An output string 
    '''

## console output ##

Executing cmd 'ls'
__init__.py
extra_feature_test
shellit.py
shellit_output.txt
cmd successful : 'ls'

## output finished ##

## Variable values ##
returncode = 0
output = "__init__.py\nextra_feature_test\nshellit.py\nshellit_output.txt"
##                 ##


returncode = 0 # Successful 
returncode !=0 # UnsuccessfulTO DOexecute shell commandssaving and return outputsSimultaneously printing and saving the outputTesting on large output
Package: shelljob
shelljobThis provides a clean way to execute subprocesses, either one or multiple in parallel, capture their output and monitor progress:Single sub processcallwith optional timeoutHigh levelFileMonitorto execute several processes in parallel and store output in a fileLow levelGroupexecution to execute jobs in parallel and capture outputAdditional tools for working with the filesystem are also included:findwhich offers much of the functionality of the shell find utilityshelljob.fs.NamedTempFileprovides awithblock wrapper for temporary named filesAPI DocumentationInstallpip install shelljobParallel SubprocessesUsing the Job system is the quickest approach to just run processes and log their output (by default in files named '/tmp/job_ID.log')from shelljob import job

jm = job.FileMonitor()
jm.run([
	[ 'ls', '-alR', '/usr/local' ],
	'my_prog',
	'build output input',
])An array will passed directly tosubprocess.Popen, a string is first parsed withshlex.split.The lower levelGroupclass provides a simple container for more manual job management.from shelljob import proc

g = proc.Group()
p1 = g.run( [ 'ls', '-al', '/usr/local' ] )
p2 = g.run( [ 'program', 'arg1', 'arg2' ] )

while g.is_pending():
	lines = g.readlines()
	for proc, line in lines:
		sys.stdout.write( "{}:{}".format( proc.pid, line ) )EncodingBy default the output will be binary encoding. You can specify anencoding='utf-8'to theruncommand to use an encoded text stream instead. Be aware that if the encoding fails (the program emits an invalid sequence) the running will be interrupted. You should also use theon_errorfunction to check for this.Line-endings will always be preserved.Simple Subprocess callsA simplifiedcallfunction allows timeouts on subprocesses and easy acces to their output.from shelljob import proc

# capture the output
output = proc.call( 'ls /tmp' )
# this raises a proc.Timeout exception
proc.call( 'sleep 10', timeout = 0.1 )FindThe 'find' funtion is a multi-faceted approach to generating listings of files.from shelljob import fs

files = fs.find( '/usr/local', name_regex = '.*\\.so' )
print( "\n".join(files) )Refer to theAPI docsfor all parameters. Just let me know if there is some additional option you need.
Package: shell-jobrunner
Job runner with loggingInstallationInstall system-wide:$pipinstallshell-jobrunnerInstall just for the current user:$pipinstall--usershell-jobrunnerUninstallation$pipuninstalljobrunnerExamplesRunsleep 5in the background$jobsleep5Runlswhen the last job finishes and it passed (exit code 0)$job-B.lsRunlswhen last job finishes (pass / fail)$job-b.lsMonitor job execution$job-WSat Aug 10, 2019 20:48:23  No jobs running, load: 0/0/0Retry a job$job--retrylsQuery ExamplesNOTE.is available as an alias to the most recently executed
job (as in the Examples above).View recently executed job log file$jobls$view`job`# Opens the output from ls using "view"View two most recently executed$jobecho1$jobecho2$view`job-n0-n1`Query by job name$jobechofoo$jobechobar$view`job-gfoo`Show job info by name$jobls$job-slsConfigurationThe default configuration file location is~/.config/jobrc, but can beoverridden using the –rc-file option.Sample rcfile:[mail]program=mail# For notifications over chat applications (like Google Chat), use chatmail as# your mail program instead. "chatmail" must be specified rather than a differently# named link to the script, else some options provided to job (such as --rc-file)# will not be passed through to it.# program = chatmaildomain=example.com[ui]watchreminder=full|summary#default=summary[chatmail]atall=all|none|noid#default=nonereusethreads=true|false#defaulttrue[chatmail.google-chat-userhooks]user1=https://chat.googleapis.com/v1/spaces/...[chatmail.google-chat-userids]# Retrieve this using your browser inspector on an existing mention of this user.# It should show up as "user/some_long_integer" somewhere in the span's metadata.user1=<longinteger>System Notifications (Systemd user service example)If you want to enable notifications when jobs finish, one way to do this is to use the –notifier
argument.~/.config/systemd/user/job-notify.service:[Unit]Description=JobrunnerNotifier[Service]Type=simpleExecStart=envjob--notifierjsonNotify.pyRestartSec=30Restart=always[Install]WantedBy=default.target~/.local/bin/jsonNotify.py:#!/usr/bin/env python3fromjsonimportloadimportsubprocessfromsysimportstdincmd=["notify-send"]data=load(stdin)rc=data.get("rc",0)ifrc!=0:cmd+=["--urgency=critical"]cmd+=[data["subject"],data["body"]]subprocess.run(cmd)HackingPrimary workflowIt’s highly recommend to work inside a virtualenv usingpipenv.Create new virtualenv and install an editable version ofjobrunner:pipenv --three install --dev
pipenv run pip install -e .Autoformat the code and check linters:pipenv run ./format.shRun tests:pipenv run pytestRun CI checks locallyThis allows you to run something similar to the azure pipelines locally using docker.It will usePIP_INDEX_URLand / or~/.config/pip/pip.confto configure a pypi mirror.This will also updatePipfile*.lock../test-docker.py [--versions 2.7 3.7 3.8] [--upgrade] [--ignore-unclean]
Package: shelllnk
ShellLnkPackage for parsing Microsoft Shell Link (.lnk) filesThis package consists of a parsing class shelllnk.ShellLnk. To use,fromshelllnkimportShellLnkopen(myfile,"rb")asfd:shell_link=ShellLnk.parse(fd)You may want to read the Microsoft spec on shell links to understand
the different parts of a shell link file. The file format doc is
athttps://msdn.microsoft.com/en-us/library/dd871305.aspxThe stuff that I use is ShellLnk.file_attributes and
ShellLnk.device_name or ShellLnk.net_name and ShellLnk.common_base_path_suffix.
The device name or net name tell you the drive letter or mount point
and the suffix gives you the path after that.
Package: shellm
shellmUse OpenAI LLMs from the command line.Quick StartInstallpipinstallshellmExport OpenAI keyexportOPENAI_API_KEY=sk-...View commandsshellm--helpCompletionsView completion helpshellmcompletion--helpCreate a simple completionshellmcompletion--prompt"Once upon a time"--max-tokens128--stream--echoChatView chat helpshellmchat--helpCreate a simple chat completionshellmchat--user-message"Tell me a story"--stream--max-tokens128
Package: shellman
Shell Script DocumentationWrite documentation in comments and render it with templates.shellmancan generate man pages, wiki pages and help text
using documentation written in shell scripts comments.For example:#!/bin/bash## \brief Just a demo## \desc This script actually does nothing.main(){case"$1"in## \option -h, --help## Print this help and exit.-h|--help)shellman"$0";exit0;;esac}## \usage demo [-h]main"$@"Output when calling./demo -h:Usage: demo [-h]

This script actually does nothing.

Options:
  -h, --help            Print this help and exit.You can see more examples in the documentation:https://pawamoy.github.io/shellman/.DemoIn the demo above we saw the three builtin templates:
helptext, manpage and wikipage.You can use your own templates
by specifying them with the--template path:my/templatesyntax.You can also write a plugin, see the docs:https://pawamoy.github.io/shellman/plugins.InstallationWithpip:pipinstallshellmanWithpipx:python3.8-mpipinstall--userpipx
pipxinstallshellmanSome projects using shellmanshellm—
A collection of scripts and libraries
built on acore inclusion-system,
all installable withbasher.
Here are a few examples:daemon—
A library that facilitates the writing of daemonized scripts that consume
files in a watched directory.debug—
A simple script that sets the verbose/dry-run/debug
Bash flags before running another script.format—
Format your output with style and color.home—
A home for your shell scripts!loop—
Control the flow of your loops (pause/resume/etc.).
Package: shell-multiprocess
Shell multiprocessA script which runs shell commands in parallel. Commands are being fed from a file.Install:$: python3 -m pip install shell-multiprocessRun:$: multiprocess -h
usage: multiprocess [-h] [-s] [-l] filename processes

Script which reads a file with shell commands and runs them in parallel
processes.

positional arguments:
  filename           Filename with commands
  processes          Amount of parallel processes

optional arguments:
  -h, --help         show this help message and exit
  -s, --soft-kill    Sends SIGINT signal to subprocesses instead of SIGKILL
                     during cleanup after CTRL-C
  -l, --log-to-file  Send multiprocess sumup to file with name
                     'multiprocess_{pid}.log'. Log is being update each time
                     an event occurs and can be viewed to monitor progress.Create a command file:$: cat > cmd.list
sleep 1 && sleep2 && echo finished_1_2
sleep 3 && echo finished_3  # finish with CTRL+DRun it in parallel - both lines should finish at the same time:multiprocess cmd.list 2
finished_3
finished_1_2
status      |        start        |         end         |       elapsed       | command
----------- | ------------------- | ------------------- | ------------------- | -------
done        | 2021-08-17 22:28:12 | 2021-08-17 22:28:15 |   0:00:03.003935    | sleep 1 && sleep 2 && echo finished_1_2
done        | 2021-08-17 22:28:12 | 2021-08-17 22:28:15 |   0:00:03.000876    | sleep 3 && echo finished_3
Package: shellodoro
star on github ⭐Right in your favorite terminalNow you do not have to be distracted from the terminal. Just work with pomodoro in terminal!Elementary usageReady to use right after installation. Just run with one simple command.And nothing more...Multifunctional & CustomizableElementary, butpowerfultool.Supports various timers - classic, 90/30, 52/17. And also yourcustom timers!If you forgot modes names, list they with one simple commandShellodoro automaticaly save yourpersonal datastatistics. Look at itdirectly from the terminal.Also shellodoro sends notifications, when pomodoro endsInstallationpip install shellodoroThen, run in terminalshdr --helpCongratulations!ContributionIf you like that repository, please star it ⭐The project is completely open for contributions! Make pull requests and submit issues.More in CONTRIBUTING.md
Package: shell-operator
Deckhouse module SDKThis package is discontinued in favor ofdeckhouse-sdkand will be deleted soonDeckhouse module SDK simplifies writing module hooks for operators:DeckhouseAddon OperatorShell Operator(values are unaccessable)NOTE:The API is in alpha stageThe name will change fromshell-operatorto something more deckhouse-related, probably,deckhouse-sdkInstallpipinstallshell-operatorSample hook# hello.pyfromshell_operatorimporthookdefmain(ctx:hook.Context):# Manipulate kubernetes state# ... object = { "kind" : "Pod", "apiVersion" : "v1", ... }ctx.kubernetes.create_or_update(object)# Export metrics# ... metric = { "name" : "power", "group": "my_hook", "set" : 9000, ... }ctx.metrics.collect(metric)# Use in-memory values for helm chart. Shell Operator does not support values, but Addon Operator and Deckhouse do.ctx.values.myModule.deployment.replicas=5if__name__=="__main__":hook.run(main,configpath="hello.yaml")# 'config' arg is also supported for raw string# hello.yamlconfigVersion:v1onStartup:10How to testAn example for pytest# hello_test.pyfromhelloimportmainfromshell_operatorimporthook# Inputs#   initial_values = { ... }#   binding_context = [ { ... } ]# Outputs#   expected_metrics = [ ... ]#   expected_kube_operations = [ ... ]#   expected_values_patches = [ ... ]#   expected_values = { ... }deftest_hello():out=hook.testrun(main,binding_context,initial_values)assertout.metrics.data==expected_metricsassertout.kube_operations.data==expected_kube_operationsassertout.values_patches.data==expected_values_patchesassertout.values.myModule.deployment.repicas==5
Package: shello-world
Shello-world: simple Python functions to run shell commandsA few simple Python functions allow you to run shell commands from your Python code.Why shello-world?It is a simple and quick solution if you don't want to use a big library or framework.UsageLet's take a look at a simple example below:fromshello_worldimportshell_execute,shell_run# Both functions work similarly# Use shell_run if you want to run a command# directly in your shell, like you'd enter itshell_run("color a")# Change font color to green# But shell_run doesn't return anythingoutput=shell_run("echo 'This text is printed in the shell'")print(outputisNone)# True# Use shell_execute to get output to use it in your code# shell_execute doesn't print anythingsysteminfo=shell_execute("systeminfo")# But it always returns result as a stringprint(systeminfo.upper())## HOST NAME:# OS NAME:# OS VERSION:# ...#Installationpippip install shello-worldpoetrypoetry add shello-worldLinksPyPIGitHub
Package: shellp
ShellPClick here to watch a demo:ShellP is a shell implemented in Python and currently in alpla stage of development. This is an example shell session that utilizesargument functions:$ echo $$random
64
$ echo $$random
40
$ echo $$tempfile
/tmp/my_temp_file.txt
$ echo $$weekday
ThursdayAdvantages over other shellsEasy to configure (e.g. PS1 value is more readable and easier to make yourself)Easy to install without root accessVariety of values that you can use for PS1, including git branch and execution duration of previous commandBasic UsageInstall ShellP:pip3 install --user shellpStart ShellP:python3 -m shellpProject LinksDocumentationGitHub repoContributing guidelinesPyPI project
Package: shellphish
Installation$ pip install shellphish && shellphishFeaturesshellphish, ** Phishing Tool for Instagram, Facebook, Twitter, Snapchat, Github **How to install ?$ pkg install python -y
$ pip install shellphish
$ shellphishRun ?$ shellphishDisclaimerWe are not responsible for your loss by this tool.
this tool is made for Education/Learning Purpose.
Dont harm anyone using this tool.Usage$ shellphish -h

Author : The Linux Choice
PIP module : Parixit Sutariya
Github : github.com/Bhai4You
Blogspot : https://bhai4you.blogspot.comGithub
Package: shell-pipe
py_ppipe介绍在Python中模拟 shell 中的管道线软件架构通过重载 | 操作符，使用subprocess模拟shell中的管道线功能安装教程xxxxxxxxxxxx使用说明p=ShellPipe()# |p| 模拟 Shell中的 管道线 |p='ls'|p|'echo'stdout,stderr=p.communicate()参与贡献Fork 本仓库新建 Feat_xxx 分支提交代码新建 Pull Request特技使用 Readme_XXX.md 来支持不同的语言，例如 Readme_en.md, Readme_zh.mdGitee 官方博客blog.gitee.com你可以https://gitee.com/explore这个地址来了解 Gitee 上的优秀开源项目GVP全称是 Gitee 最有价值开源项目，是综合评定出的优秀开源项目Gitee 官方提供的使用手册https://gitee.com/helpGitee 封面人物是一档用来展示 Gitee 会员风采的栏目https://gitee.com/gitee-stars/
Package: shell-piper
shell-piperShell-piper is a commandline program made to write to a temporary file with your
editor and pass that file's contents to an external program through various methods.InstallationThe recommended way to install shell-piper is throughpipx(pipx install shell-piper). Arch users can also install shell-piper fromthe AUR.You can also clone this repository and build shell-piper manually:gitclone'https://github.com/Mrfiregem/shell-piper.git'cdshell-piper
flitinstallQuickstartStdin ModeCopy and paste text into your editor and modify it withawk:shellpiper--awk-F$'\t''{ print $2 }'Argument ModeConvert pasted html into markdown withpandoc:shellpiper--typeargument--pandoc'{piper:file}'--fromhtml-oconverted.mdThe argument{piper:file}will be expanded by shell-piper to the full path of
the temporary file. If this argument is not present, the file path will be appended
as the last argument.Expand ModePass a list of urls to download withyoutube-dl, with each line as an argument:shellpiper-txyoutube-dlUsageusage: shellpiper [-h] [-v] [-V] [-t TYPE] [-k] program [args ...]

Write a temporary file and pass it to a program

positional arguments:
  program               The program to pass your file to
  args                  Arguments to pass to the program

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -V, --verbose         Show debug messages
  -t TYPE, --type TYPE  How the file will be given to the program
  -k, --keep-empty      Don't remove empty lines when using '--type expand'

Use '--' to prevent command flags to the right of it being parsed by piper.

The '--type' flag can take values 'stdin' (default), 'argument', or 'expand',
or the letters 's', 'a', or 'x', respectively. This determines how the file is
passed to your program by shellpiper.
Package: shell-pipes
Python Shell PipesA simple way to access your shell commands in PythonTheshpipespackage usessubprocess.Popento run commands in a shell easily from native Python.>>>fromshpipesimportPipe# python --version>>>Pipe('python')('--version').getvalue()'Python 3.8.6\n'Chaining pipes togetherYou can chain together your commands, passing output from one to the input of another, similar to shell pipes. You can use the bitwise inclusive or operator to chainPipeinstances together.# echo 1+1 | bc>>>(Pipe('echo')('1+1')|Pipe('bc')).getvalue()'2\n'# This also works>>>pipe=Pipe('echo')('1+1')>>>pipe|=Pipe('bc'))>>>pipe.getvalue()'2\n'Loading commands from yourPATHShell Pipes can also collect all executables from yourPATHvariable and gather them into aCommandsinstance so you can use the lib just like your native shell.>>>fromshpipesimportCommands>>>shell=Commands()# find . -type f | grep .py$ | wc -l>>>(shell.find('.','-type','f')|shell.grep('.py$')|shell.wc('-l')).getvalue()'9\n'# this also works>>>pipe=shell.find('.','-type','f')>>>pipe|=shell.grep('.py$')>>>pipe|=shell.wc('-l')>>>pipe.getvalue()'9\n'Handling pipe argumentsWhen aPipeis called, its arguments are directly passed toPopenso beware that strings must be quoted properly.
You can usegetvalue()to get the output from one pipe and then pass it as a command argument instead of input text.
Pipes are only evaluated whengetvalue()is called>>>license=shell.find('.','-name','"LICENSE"').getvalue()>>>shell.wc(license).getvalue()'  21  169 1069 ./LICENSE\n'Shell by defaultSince pipes run in a shell by default, environment variables evaluate automatically>>>pipe=shell.ps('-u $USER')>>>pipe|=shell.grep('python')>>>pipe|=shell.head('-1')Configuration optionsIf you need to run a different shell or disable shell entirely, then you can pass options via environment variables or kwargs toPipeOverriding options inPipeYou can override all options toPopen(exceptstdin/stdout) by passing arguments toPipeBy defaultPopenis run in shell mode with your default shell.>>>Pipe('ls',executable='/bin/zsh',cwd='/var',shell=False)Set envSHPIPES_NO_SHELL=trueSetsshell=Falsein the call toPopenSet envSHPIPES_SHELL=/bin/zshChanges the executable shell run byPopen
Package: shellplot
shellplot“We should have never left the command line.”Shellplot is the plotting package that you didn’t know you needed. Plotting,
straight outta the command line.Please take a look at thedocumentation, which contains manyexamples.Installation$pipinstallshellplotQuickstartShellplot loosely replicates thematplotlibAPI, offering both a figure and
functionalapi. It currently supports scatter, line, histogram, bar and
boxplots, with many options to customize the figure. It’s as easy as:>>>importshellplotasplt>>>df=plt.load_dataset("penguins")>>>plt.plot(df["bill_length_mm"],df["flipper_length_mm"],color=df["species"])flipper_length_mm
 232┤                                    o oo  oo    o o        o
    |                                     oo o  o       o
    |                                      oooo
    |                            o oooo ooo oo   o
    |                        oo oooo oo o o o o    o
 217┤                       o o oo ooooo ooo o
    |                   o   o o ooooo o o*oo
    |                     o oo + oooo oooo   *  *
    |                   +   oooo o       o      *       *
    |                   ++              o *  **   **
 202┤        +           +    *             ** **    *
    |      +    ++++   +  +      *    **   ****
    |        ++    +++ +++ +++ +  ** **   ***** **
    |     +++  ++++   ++ ++  +    *+**     * ***
    |   +  + ++++++++++ ++++     *+***  *   *
 187┤+    + + ++ +++++++*+ * *    **           *
    |    ++  ++++++ + +++            *
    |          + ++ +  + + *                                 *
    |  +        ++   +             *                              + Adelie
    |            +     +                                          * Chinstrap
 172┤             +                                               o Gentoo
    └┬----------┬---------┬----------┬----------┬----------┬------
     32         37        42         47         52         57
                            bill_length_mmShellplot also provides a convenient integration withpandas. Simply set the
pandas plotting backend to shellplot:>>>importpandasaspd>>>pd.set_option("plotting.backend","shellplot")Please refer topandas visualisationpage for further details.NoteThis project has been set up using PyScaffold 3.2.3. For details and usage
information on PyScaffold seehttps://pyscaffold.org/.
Package: shellplus
ShellPlusShellPlus is a Python package designed to streamline terminal text formatting, providing predefined styles and colors for efficient coding with colors and formatting in the terminal.InstallationYou can install ShellPlus using pip3:pip3installshellplusExample usage:fromshellplusimportstyles,colors1ascolors# Print a warning messagestyles.print('This is a warning message.','warn')# Print a soft error messagestyles.print('This is a soft error message.','serr')# Print a colorful message using 'gum pink'colors.print('This is a colorful message.','gum pink')# Print a differently colorful message using 'salmon'colors.print('This is a differently colorful message.','salmon')