Saravanan666/pypi-org huggingface dataset:
Package: shell-whisperer
🔮 Shell Whisperer 🔮Shell Whisperer is a command-line tool that generates CLI (Command Line Interface) commands based on natural language input. Powered by OpenAI's GPT-3.5-turbo language model, Shell Whisperer can understand a wide range of tasks described in plain English and provide the corresponding shell commands. Optionally, it can also provide explanations of how the generated commands work.FeaturesGenerate shell commands based on natural language descriptions.Supports a variety of tasks, from file management to system administration.Option to provide explanations for the generated commands.User-friendly (🧢) command-line interface.InstallationTo install Shell Whisperer, you can use pip, the Python package manager. We recommend installing Shell Whisperer in a virtual environment to isolate it from your system Python environment.Creating a Virtual Environment
To create a virtual environment, follow these steps:# Navigate to your desired directorycd/path/to/directory# Create a virtual environment named 'venv'python3-mvenvvenv# Activate the virtual environmentsourcevenv/bin/activate# On macOS and Linuxvenv\Scripts\activate# On WindowsInstalling Shell WhispererWith the virtual environment activated, you can install Shell Whisperer from PyPI using the following command:pipinstallshell-whispererThis will download and install Shell Whisperer and its dependencies.UsageOnce installed, you can use the whisperer command (or the entry point you defined) to interact with Shell Whisperer. Here's an example of how to use the tool:Ask Shell Whisperer to generate a commandwhispererrequest"list all files in the current directory"You can also request an explanation of the generated commandwhispererrequest"list all files in the current directory"--explainContributingI welcome contributions to Shell Whisperer! If you encounter any issues or have feature requests, please feel free to open an issue on the project's repository.LicenseShell Whisperer is released under the MIT License.
Package: shellwords
Parse line as shell words.GitHub:https://github.com/mozillazg/python-shellwordsLicense: MIT licensePyPI:https://pypi.python.org/pypi/shellwordsPython version: 2.6, 2.7, pypy, 3.3, 3.4Usage>>>fromshellwordsimportShellWords>>>s=ShellWords()>>>s.parse("./foo --bar=baz")[u'./foo',u'--bar=baz']>>>s.parse('./foo --bar=baz foobar')[u'./foo',u'--bar=baz',u'foobar']>>>os.environ['FOO']='bar'>>>s=ShellWords(parse_env=True)>>>s.parse("./foo $FOO")[u'./foo',u'bar']>>>s=ShellWords(parse_backtick=True)>>>s.parse("./foo `echo $SHELL`")[u'./foo',u'/bin/bash']ThanksThis is based ongo-shellwordspackage.Changelog0.1.0 (2015-01-29)Initial Release
Package: shellwrap
ShellWrapThis small module allows you to writeshellcommands inside your
Python program. This module is not a replacement forsubprocessor
any of the Python modules that are a high level abstractions on top of
program and command execution or shell interaction. On the contrary
ShellWrap executes a shell interpreter that will live as long as your
Python script is running. A simple function decorator will allow
Python function to have a shell script body. These functions will be
augmented and passed to the shell interpreter. Let's start with some
examples:Example: Check if a site is UPThis example will regularily check for the given site to respond with a 200, Ok.
This is handy when you are waiting for a site to become responsive or waiting
for it to boot up.importtimefromshellwrapimportShellWrapshell=ShellWrap('bash').get_shell()@shell()defis_the_site_up(url):'curl -sL -m 2 -w "%{http_code}" "${url}" -o /dev/null | grep -q 200'whileis_the_site_up('https://google.com').fails():time.sleep(4)You just have to annotate a function with the@shelldecorator and it will
be parsed and each line (a loose string) will be fed into a runningbashinterpreter.Example: Getting resultsThe return value of calling a function annotated with@shellis aResulttype that has a few convenience functions:Result().fails()returns True if the command failed (its exitcode is != 0)Result().success()returns True if the command succeeded (equivalent tonot .fails())Result().exitcodecontains the exit code of the last command executed in your functionResult().stdoutcontains all the output of the execution of your functionExample: Passing arguments to functionsYou can define a function with arguments, likeis_the_site_upabove and these
arguments will be converted into variables for the execution of your function,
inside thebashenvironment.@shell()defpassing_arguments_to_funcs(arg0,arg1,someother):'echo "got $arg0 and $arg1"''echo "and also $someother"'result=passing_arguments_to_funcs('hello',10,'love you bash')assert(result.exitcode==0)This will result in the following being displayed:got hello and 10
and also I love you bashExample: TimeoutsYou might have a process that you only want to execute for a few seconds, for it to return.
If the process get stuck, you want to kill it and continue with your life. This is possible
withShellWrapby using thetimeoutparameter in your decorator.@shell(timeout=3)defwill_timeout_in_3_secs(mymessage):'sleep 1''echo "${mymessage}"''sleep 1'result=will_timeout_in_3_secs('Only patience will reveal the truth.')ifresult.success():print('Your patience will be rewarded')In the last example, we will give the decorated function 10 seconds to run, and we know it will
take around 8 seconds to complete. The first run will succeed, but if you change thetimeoutparameter to 7, the function will fail. Will still print the message passed as an argument to the
function (theechowas called), but the function will result in an error, as it was killed because
of the timeout.Contributing to the projectPlease see ourContributionpage!LicenseThe project is distributed under theMIT license.
Package: shellxec
⚓ shellxec ⚓Shellxecis a Python library for running shell commands on both Windows and Linux systems.
This library can be used to execute shell command from Python. This can be used to run codes in other languages such as C++, Java or Rust directly from Python and can also retain results if required.Python is very much slow copared to other languages such as C++, Java or Rust. This library can be used to perform speed up the complex tasks and calculations by running them in other languages, while retaining the output in Python for further use.InstallationYou can installshellxecusing pip:pipinstallshellxecUsageBasic UsageImport theshellxeclibrary and call the method for it:Basic example to compile a CPP/C++ fileimportshellxecassx# Compile a CPP filecommand="g++ main.cpp"sx.run_command(command)Run a Shell Commandcommand="echo 'Hello, ShellExec!'"sx.run_command(command)Run a Shell Command and Capture Output (String)command="echo 'Hello, ShellExec!'"output=sx.run_command(command=command,output=True)print("Output: ",output)Advanced UsageRun a Command in a Specific Directorycommand="dir"directory="hello"sx.run_command_in_directory(command,directory)Run a Command in a Specific Directory while retaining the output (String)command="dir"directory="hello"result=sx.run_command_in_directory(command,directory,output=True)print(result)Run a Command with Custom Environment Variablescommand="echo $MY_VARIABLE"env={"MY_VARIABLE":"Hello from ShellExec"}sx.run_command_with_env_var(command,env)Run a Command with Custom Environment Variables while retaining the output (String)command="echo $MY_VARIABLE"env={"MY_VARIABLE":"Hello from ShellExec"}result=sx.run_command_with_env_var(command,env,output=True)print(result)Run a Batch of Commandscommands=["echo 'Command 1'","echo 'Command 2'","echo 'Command 3'"]sx.run_commands_batch(commands)Run a Batch of Commands while retaining the output (Array)commands=["echo 'Command 1'","echo 'Command 2'","echo 'Command 3'"]result=sx.run_commands_batch(commands,output=True)print(result)Running TestsStatus: Wrote Tests (Need more test cases)Checklist:Test CasesSave To File OptionLicenseThis project is not under any License (YET).
Package: shelly-cloud
shelly-cloudA python library to access the Shelly cloud API. Refer also to theShelly API Docs. This repo provides functionality for:Getting devices statusGetting the status of a single deviceGetting a list of device IDsInstalling the library locallyPython 3 is recommended for this project.python-mpipinstall-e.This is needed for the first time when working with the library/examples/tests.Example usageSHELLY_API_URL="https://HOST:PORT"SHELLY_API_TOKEN="REPLACE_ME"python3examples/simple.pyorfromshellyapi.shellyapiimportShellyApishelly=ShellyApi('provide_api_url','provide_api_token')# or you can define additional optional parameters# shelly = ShellyApi('provide_api_url', 'provide_api_token', timeout=10)print(shelly.get_device_ids())DevelopmentInstalling required pip packagespythonpipinstall-rrequirenments.txt
pre-commitinstall-tpre-pushLintingpylintshellyapi/*.pytests/*.pyexamples/*.pyUnit testingpytesttests/*.py# show logspytest-olog_cli=true# code coveragepytest--durations=10--cov-reportterm-missing--cov=shellyapitests
Package: shelly-restrict
At the moment this Script is nowhere near being complete, use at your own risk!ShellyStuff based around the beautifull small electronic devices from AlltercoAuto-Restrict-LoginThis Script queries trough a given number of ips and restricts the http login with a given username and passwordInstallationTo install the Script(s) run:pip install shelly-restrictUsageTo use the script run:The Script requires the ips as fourth parameter, each seperated by a comma eg ip1,ip2,...When a login page is already restricted you will be prompted to provide the old passwordThe Scriptdoesntwork with mdns names, just ip addressesThe Script will automatically generate a file called Shelly.json in the same directory as the script, to store the last username and the hash of the last password.python3 secure.py [mode] [username] [password] [ip1,ip2]
  mode  enable/disableError-Codes0: Failed to load Shelly.json, check the directory and path. (The script cant find theCredentials-File)1: Wrong password entered. (The provided password doesnt match with the saved hash)2: Right hash found but wrong password provided. (The entered password matches the saved hash, but not the actual password on the login page)3: Found Shelly.json, but didnt find entry for this device. (The script found theCredentials-File, but the restricted login was never enabled with this script)Credentials-FileThe Credentials-File (Shellys.json) is generated and then located in the same directory as the script.
The structure is:{"devices": [{"ip": "192.168.xxx.xxx", "username": "test", "password": "$pbkdf2-sha256$30000$yZnzPqc0Rqi1NibEeM.5Fw$QZ0sk1Z6K4LMt3UM3AGrrKLk9jBOjwrXsY1psfAPY4Q"}, {"ip": "192.168.xxx.xxx", "username": "test", "password": "$pbkdf2-sha256$30000$yZnzPqc0Rqi1NibEeM.5Fw$QZ0sk1Z6K4LMt3UM3AGrrKLk9jBOjwrXsY1psfAPY4Q"}]}
Package: shelly-restrict-login-page
At the moment this Script is nowhere near being complete, use at your own risk!ShellyStuff based around the beautifull small electronic devices from AlltercoAuto-Restrict-LoginThis Script queries trough a given number of ips and restricts the http login with a given username and passwordInstallationTo install the Script(s) run:pip install shelly-restrict-login-page==0.0.4UsageTo use the script run:The Script requires the ips as fourth parameter, each seperated by a comma eg ip1,ip2,...When a login page is already restricted you will be prompted to provide the old passwordThe Scriptdoesntwork with mdns names, just ip addressesThe Script will automatically generate a file called Shelly.json in the same directory as the script, to store the last username and the hash of the last password.python3 secure.py [mode] [username] [password] [ip1,ip2]
  mode  enable/disableError-Codes0: Failed to load Shelly.json, check the directory and path. (The script cant find theCredentials-File)1: Wrong password entered. (The provided password doesnt match with the saved hash)2: Right hash found but wrong password provided. (The entered password matches the saved hash, but not the actual password on the login page)3: Found Shelly.json, but didnt find entry for this device. (The script found theCredentials-File, but the restricted login was never enabled with this script)Credentials-FileThe Credentials-File (Shellys.json) is generated and then located in the same directory as the script.
The structure is:{"devices": [{"ip": "192.168.xxx.xxx", "username": "test", "password": "$pbkdf2-sha256$30000$yZnzPqc0Rqi1NibEeM.5Fw$QZ0sk1Z6K4LMt3UM3AGrrKLk9jBOjwrXsY1psfAPY4Q"}, {"ip": "192.168.xxx.xxx", "username": "test", "password": "$pbkdf2-sha256$30000$yZnzPqc0Rqi1NibEeM.5Fw$QZ0sk1Z6K4LMt3UM3AGrrKLk9jBOjwrXsY1psfAPY4Q"}]}
Package: shelve
This shelve command-line toolshelve.pysupports shelving changes for
Mercurial and Subversion (1.7.x+) repositories similar togit stash.  One
major difference withgit stashis that changes are not stored in a stack,
but rather as a named patch in a predefined location (~/.shelf).Shelve allows to user to temporarily shelve all changes in a dirty working
directory away to the shelf. All changes in the repository are reverted, and the
repository is back in a clean state.UsageTo temporarily shelve all changes including all added and removed files in a
repository issue:$ shelve.py <patch name><patch name>is a user-defined name that describes the contents of the
patch. In case a patch with the given name already exists, shelve will ask to
user to either overwrite the existing patch, or specify an alternative name for
the patch. The shelve command can be issued from any path within a repository,
provided it is either a Mercurial or Subversion respository.All changes that are shelved in this way can be inspected usingshelve.py-l, and shown usingshelve.py-s<patch name>.Changes that were previously saved can be restored again usingshelve.py-a<patch name>,  potentially on top of a different commit. In case the changes
applied cleanly to the current repository, the entry for the patch is
automatically removed from the shelf.  Otherwise, the files will be merged in
place (similar tomerge), and the patch will remain in the shelf.For more information on the usage of shelve:$ shelve.py -hBash completion supportWhen installing shelve, a command-line completion script is automatically
installed to/etc/bash_completion.d. This provides support for auto
completing patch names in Bash.
Package: shelved-cache
Shelved CachePersistent cache implementation for Pythoncachetools.Behaves like anyCacheimplementation, but entries are persisted to disk.Original repository:https://github.com/mariushelf/shelved_cacheUsage examplefromshelved_cacheimportPersistentCachefromcachetoolsimportLRUCachefilename='mycache'# create persistency around an LRUCachepc=PersistentCache(LRUCache,filename=filename,maxsize=2)# we can now use the cache like a normal LRUCache.# But: the cache is persisted to disk.pc["a"]=42pc["b"]=43assertpc["a"]==42assertpc["b"]==43# close the filepc.close()# Now in the same script or in another script, we can re-load the cache:pc2=PersistentCache(LRUCache,filename=filename,maxsize=2)assertpc2["a"]==42assertpc2["b"]==43Use as a decoratorJust like a regularcachetools.Cache, thePersistentCachecan be used withcachetools'cacheddecorator:importcachetoolsfromshelved_cacheimportPersistentCachefromcachetoolsimportLRUCachefilename='mycache'pc=PersistentCache(LRUCache,filename,maxsize=2)@cachetools.cached(pc)defsquare(x):print("called")returnx*xassertsquare(3)==9# outputs "called"assertsquare(3)==9# no output because the cache is usedFeaturespersistent cacheSee usage examples above.Async decoratorsThe package contains equivalents forcachetools'cachedandcachedmethoddecorators which support wrapping async methods. You can find them in thedecoratorssubmodule.They support both synchronousandasynchronous functions and methods.Examples:fromshelved_cacheimportcachedasyncmethodfromcachetoolsimportLRUCacheclassA:# decorate an async method:@cachedasyncmethod(lambdaself:LRUCache(2))asyncdefasum(self,a,b):returna+ba=A()assertawaita.asum(1,2)==3classS:@cachedasyncmethod(lambdaself:LRUCache(2))defsum(self,a,b):returna+bs=S()asserts.sum(1,2)==3Support for lists as function argumentsUsing theautotuple_hashkeyfunction, list arguments are automatically converted
to tuples, so that they support hashing.Example:fromcachetoolsimportcached,LRUCachefromshelved_cache.keysimportautotuple_hashkey@cached(LRUCache(2),key=autotuple_hashkey)defsum(values):returnvalues[0]+values[1]# fill cacheassertsum([1,2])==3# access cacheassertsum([1,2])==3Changelog0.3.0add support for Python 3.10 and 3.11better error message when trying to use the same file for multiple cachesCI/CD pipelinefixes for documentation0.2.1improved error handlingAcknowledgementscachetoolsby Thomas Kemmerasyncacheby hephexLicenseAuthor: Marius Helf (helfsmarius@gmail.com)License: MIT -- seeLICENSE
Package: shelve-it-cli
Shelve It CLIAssigning containers to locations in ArchivesSpace.RequirementsThis module requires theshelve_itplugin to be enabled
for ArchivesSpace.Shelve It CLI is a Python module and can be installed using pip:pip3installshelve_it_cliUsageCreate a basic configuration file with these settings:base_url: http://localhost:4567 # update to your api url
username: admin
password: adminDo not useadminwith a production system. The user must be able to:view repositoryupdate containersupdate locationsTest the connection to ArchivesSpace:shelve_it_cliping--config=/path/to/config.yml# test config for devs running the backend locallyshelve_it_cliping--config=config.test.ymlCreate a CSV containing two columns with data to import. For example:repo_code,container_barcode,location_barcode
test,123456,987654Run the command to import it:shelve_it_cliprocess--config=/path/to/config.yml--data=/path/to/import.csv--output=/path/to/result.csvDeveloper setup# install system wide for editors (optional)
pip3 install ArchivesSnake fire
# install within virtualenv
virtualenv venv --python=python3
source venv/bin/activate
pip3 install -r requirements.txt

# commands
python shelve_it_cli.py ping --config config.test.yml
python shelve_it_cli.py process --config config.test.yml --data barcodes.csv --output result.csv

# test install
python -m unittest discover
pip3 install .
pip3 uninstall shelve_it_cliPublishingpip3 install twine
Package: shenafield
shenafieldshenafield is a Python library that replicates the unique typing style of shenafield. This library allows users to transform their text into the distinctive style in which shenafield talks.InstallationTo install shenafield, you can usepipxby running the following command:pipxinstallshenafieldNote: shenafield requires an OpenAI API key to function properly. Please make sure you have obtained an API key fromOpenAIand set it as theOPENAI_API_KEYenvironment variable or in a.envfile. Alternatively, you can pass your API key through the--api-keyoption.UsageTo transform a message into the shenafield style, use the following command:shenafieldtransform[message]Replace[message]with the text you want to convert. The result will be printed to the console.Alternatively, you can launch the interactive shell by running:shenafieldshellThe interactive shell allows you to input multiple messages, and shenafield will transform each one into the unique typing style.
Package: shenfun
Try it in a jupyter hub using BinderDescriptionShenfun is a high performance computing platform for solving partial differential equations (PDEs) by the spectral Galerkin method. The user interface to shenfun is very similar toFEniCS, but applications are limited to multidimensional tensor product grids, using either Cartesian or curvilinear grids (e.g., but not limited to, polar, cylindrical, spherical or parabolic). The code is parallelized with MPI through thempi4py-fftpackage.Shenfun enables fast development of efficient and accurate PDE solvers (spectral order and accuracy), in the comfortable high-level Python language. The spectral accuracy is ensured by using high-orderglobalorthogonal basis functions (Fourier, Legendre, Chebyshev first and second kind, Ultraspherical, Jacobi, Laguerre and Hermite), as opposed to finite element codes that are using low-orderlocalbasis functions. Efficiency is ensured through vectorization (Numpy), parallelization (mpi4py) and by moving critical routines toCythonorNumba. Shenfun has been used to run turbulence simulations (Direct Numerical Simulations) on thousands of processors on high-performance supercomputers, see thespectralDNSrepository.The demo folder contains several examples for the Poisson, Helmholtz and Biharmonic equations. For extended documentation and installation instructions seeReadTheDocs. For interactive demos, see thejupyter book. Note that shenfun currently comes with the possibility to use two non-periodic directions (seebiharmonic demo), and equations may be solved coupled and implicit (seeMixedPoisson.py).Note that shenfun works with curvilinear coordinates. For example, it is possible to solve equations on asphere(using spherical coordinates), on the surface of atorus, on aMöbius stripor along anycurved line in 2D/3D. Actually, any new coordinates may be defined by the user as long as the coordinates lead to a system of equations with separable coefficients. After defining new coordinates, operators like div, grad and curl work automatically with the new curvilinear coordinates. See alsothis notebook on the sphereor an illustration of thevector Laplacian.For a more psychedelic experience, have a look at thesimulationof the Ginzburg-Landau equation on the sphere (click for Youtube-video):Shenfun can also be used to approximate analytical functions with global spectral basisfunctions, and to integrate over highly complex domains, like the seashell below, seethis demo.InstallationShenfun can be installed using eitherpiporconda, seeinstallation chapter on readthedocs.DependenciesPython3.7 or above. Test suits are run with Python 3.8, 3.9 and 3.10.A functional MPI 2.x/3.x implementation likeMPICHorOpen MPIbuilt with shared/dynamic libraries.FFTWversion 3, also built with shared/dynamic libraries.Python modules:NumpyScipySympyCythonmpi4pympi4py-fftContactFor comments, issues, bug-reports and requests, please use the issue tracker of the current repository, or seeHow to contribute?at readthedocs. Otherwise the principal author can be reached at:Mikael Mortensen
mikaem at math.uio.no
https://mikaem.github.io/
Department of Mathematics
University of Oslo
Norway