Saravanan666/pypi-org huggingface dataset:
Package: scriptharness
Scriptharness*************Scriptharness is a framework for writing scripts.  There are threecore principles: full logging, flexible configuration, and modularactions.  The goal of *full logging* is to be able to debug problemspurely through the log.  The goal of *flexible configuration* is tomake each script useful in a variety of contexts and environments.The goals of *modular actions* are a) faster development feedbackloops and b) different workflows for different usage requirements.Full logging============Many scripts log.  However, logging can happen sporadically, and it'sgenerally acceptable to run a number of actions silently (e.g.,"os.chdir()" will happily change directories with no indication in thelog).  In *full logging*, the goal is to be able to debug bustagepurely through the log.At the outset, the user can add a generic logging wrapper to anymethod with minimal fuss.  As scriptharness matures, there will bemore customized wrappers to use as drop-in replacements forpreviously-non-logging methods.Flexible configuration======================Many scripts use some sort of configuration, whether hardcoded, in afile, or through the command line.  A family of scripts written by thesame author(s) may have similar configuration options and patterns,but often times they vary wildly from script to script.By offering a standard way of accepting configuration options, andthen exporting that config to a file for later debugging orreplication, scriptharness makes things a bit neater and cleaner andmore familiar between scripts.By either disallowing runtime configuration changes, or by explicitlylogging them, scriptharness removes some of the guesswork whendebugging bustage.Modular actions===============Scriptharness actions allow for:* faster development feedback loops.  No need to rerun the entiretyof a long-running script when trying to debug a single action insidethat script.* different workflows for different usage requirements, such asrunning standalone versus running in cloud infrastructureThis is in the same spirit of other frameworks that allow for discretetargets, tasks, or actions: make, maven, ansible, and many more.Running unit tests==================Linux and OS X--------------# By default, this will look for python 2.7 + 3.{3,4,5}.# You can run |tox -e ENV| to run a specific env, e.g. |tox -e py27|pip install toxtox# alternately, ./run_tests.shWindows-------# By default, this will look for python 2.7 + 3.4# You can run |tox -c tox_win.ini -e ENV| to run a specific env, e.g. |tox -c tox_win.ini -e py27|pip install toxtox -c win.ini
Package: script-house
script-house人是喜欢折中的。如果让我用 Python，我是不愿意的。但如果让我用 DOS 命令写脚本，我一定勤勤恳恳地学 Python。这个仓库是一个方便日常使用的 python 工具包 ——script-house。开箱即用的功能以xxOperation的形式命名，目前已有：FileSystemOperation.py但是script_house.utils包中的功能实际上更为有用如何本地安装python.exe.\setup.pybdist_wheelsdist
pipinstall.如何上传到 pypi拿api_token创建 .pypirc 文件，放到$HOME目录（Windows 的话，放到C:\Users\用户名下）
.pypirc 格式：[pypi]username=__token__password=<api_token>pip install wine上传：twine upload dist/*os-shell-script以前的脚本，待用 python 重构windows-cmd脚本名作用random-open.cmd（使用指定软件）打开当前文件夹下的一个随机文件generate-random-file.cmd在当前目录下生成一个随机文本文件linux-shell脚本名作用start-mysql-cluster-in-docker.sh启动一个临时的一主二从 MySQL 主从复制集群，以 3 个 Docker 容器的形式运行start-redis-cluster-in-docker.sh启动一个临时的3主3从的 Redis 集群，以 6 个 Docker 容器的形式运行start-kafka.sh按照顺序，依次启动 Zookeeper 和 Kafkastop-kafka.sh按照顺序，依次停止 Kafka 和 Zookeeperpowershell脚本名作用random-open.ps1（使用指定软件）打开当前文件夹下的一个随机文件random-open-from-multiple-folders.ps1（使用指定软件）打开多个文件夹下的一个随机文件extract-markdown-image.ps1解析 markdown 文件中引用的所有本地图片的路径，并拷贝/剪切到指定文件夹内
Package: scription
scriptionlight-weight library to enhance command-line scripts; includes conversion of
parameters to specified data types, parameter checking, basic input/output with
users, support for suid [1], sending email, executing sub-programs, and having
sub-commands within a scriptdecoratorsScript:  sets global variables and/or parameters for Commands; the decorated
function will be called by Main/Run before any specified CommandCommand:  marks function as a subcommand for the script (e.g. add, delete,
list, etc.); if no subcommand is specified on the command-line, scription
will look for a Command with the same name as the scriptAlias:  registers other names for Commands (e.g. delete / remove / kill)functionsMain:  if the importing module’s __name__ is __main__, call Run() (this
allows for importing the script as a module)Run:  unconditionally attempts to run the Script function (if any) and the
Command found on the command-lineMain() or Run() should be the last thing in the scriptclassesSpec:  can be used when defining the command-line parameters (can also just
use tuples)helper functions/classesabort: quits immediately by raising SystemExitExecute:  class for executing other programs; uses subprocess.Popen by
default, but ifpty=Trueis specified thenpty.forkwill be used
(handy for programs that only accept input from a pty)get_response:  function for displaying text and getting feedbackhelp: quits immediately, but adds a reference to –help in the quit messagelog_exception:  logs an exception with logging.loggermail: rudimentary mail senderOrmFile:  lightweight orm – supports str, int, float, date, time,
datetime, bool, and path (which defaults to str); custom data types can
also be specifiedprint: wrapper around print that adds a ‘verbose_level’ keyword (default: 1);
default verbosity is 0 (so print does nothing), but can be increased using
-v, -vv, –verbose, or –verbose=2 (in Python 2 the script must use
‘from __future__ import print_function’ to use scription’s print)user_ids:  context manager useful for suid scripts – all actions taken
within the context are run as the user/group specifiedfeaturesextra parameters defined by Script are global, and can be accessed from any
function or Command‘module’ is a namespace inserted into the script‘script_command’ is the Command selected from the command line (useful when
one needs to call the subcommand directly from a main() function)‘script_command_name’ is the name of the script_command‘script_verbosity’ is the level of verboseness selected (defaults to 0)‘script_name’ is the name of the scriptbuiltin options are:  –help, –verbose (-v or -vv), –version, –all-versions
–version attempts to display the version of the main package in use
–all-versions attempts to display the versions of any imported packagescommand-line is decoded to unicode under Python 2 (Python 3 does this for us)[1] I use the suid-python program, available athttp://selliott.org/python/suid-python.c
Package: scriptlock
Lock tool for scripts.PackageExampleimporttimeimportatexitfromscriptlockimportLocklock=Lock()atexit.register(lock.cleanup)# Needed to clean the lock correctlytime.sleep(100)Launch another one and see what happendWorkaroundThe use of atexit is necessary to correctly clean the lock. We tried to
use thedelmodule but it caused issues with the logger.TestsTesting is set up usingpytestand coverage is
handled with the pytest-cov plugin.Run your tests withpy.testin the root directory.Coverage is ran by default and is set in thepytest.inifile. To see
an html output of coverage openhtmlcov/index.htmlafter running the
tests.TODOTravis CIThere is a.travis.ymlfile that is set up to run your tests for
python 2.7 and python 3.2, should you choose to use it.TODO
Package: scriptman
ScriptMan - A Python Package for Script ManagementScriptMan is a Python package that provides a comprehensive set of tools and utilities for managing Python scripts. Whether you're working with data, databases, command-line interfaces, web automation, or just need better script organization, ScriptMan has you covered.InstallationYou can install ScriptMan using pip:pipinstallscriptmanUsageimportscriptman# Example: Run a scriptscriptman.ScriptsHandler().run_script('my_script.py')FeaturesCleanUpHandlerProvides cleanup functionalities for scripts.CLIHandlerHandles command-line interface interactions.CSVHandlerOffers utilities for working with CSV files.DatabaseHandlerProvides database interaction capabilities.DirectoryHandlerManages directories and file operations.ETLHandlerOffers tools for Extract, Transform, Load (ETL) processes.LogHandlerHandles logging with different log levels.LogLevelEnum for different log levels.ScriptsHandlerManages the execution of scripts.SeleniumHandlerProvides tools for web automation using Selenium.SeleniumInteractionEnum for Selenium-based interactions.SettingsAccesses and manages package settings.InitializationTo set up ScriptMan for your project, you should call the following method from theSettingsclass upon start:fromscriptmanimportSettingsSettings.init(root_dir='your_project_directory',logging=True,# Enable logging (default is True)debugging=False,# Enable debugging mode (default is False))Calling this method will set up ScriptMan's app files in your project directory under the app folder. It will create various folders:downloads: Used for downloads (e.g., Downloads made by Selenium).helpers: Used for any extra modules you want to reuse in your code (e.g., API Classes).scripts: Where your scripts should reside.Logs: Where the log files will be saved.DocumentationFor detailed documentation and examples, please refer to thepackage documentation.Example# Import ScriptMan modulesimportscriptman# Create a ScriptsHandler instancescript_handler=scriptman.ScriptsHandler()# Run a Python scriptscript_handler.run_script('my_script.py')ContributingWe welcome contributions! Please feel free to submit issues and pull requests to help improve this package.LicenseThis package is distributed under theMIT License.
Package: script-master
Script-MasterСервис, который по конфигам (формат YAML),
создает задания запуска скриптов в сервисеProcess-Executor,
согласно плану запусков полученных от сервисаWork-Planner.Отлично подходит для запуска ETL скриптов по расписанию.Требует мало ресурсов, не требует БД, конфигурации скриптов
и их параметры запуска (расписание) создаются в YAML конфигах,
поэтому интерфейс не требуется, но он есть, дополнительно можно поставить.Installpoetry add script-masterorpip install script-masterRunscript-master --help
script-master init # Создаст конфиг в текущий директории
script-master run # Запускать всегда в директории, в которой был выполнен initoruvicorn script_master.main:app --port 8080 --reloadИнтерфейсЕстьинтерфейс, он не обязателен. Для сервиса требуются только конфиги yaml, их иожно вручную создавать
Запускается отдельно/
Package: scriptmerge
scriptmerge: Convert Python packages into a single scriptScriptmerge can be used to convert a Python script and any Python modules
it depends on into a single-file Python script.
There are likely better alternatives depending on what you're trying to do.
For instance:If you want to create a single file that can be executed by a Python interpreter,
usezipapp.If you need to create a standalone executable from your Python script,
I recommend using an alternative such asPyInstaller.Since scriptmerge relies on correctly analysing both your script and any dependent modules,
it may not work correctly in all circumstances.InstallationpipinstallscriptmergeUsageYou can tell scriptmerge which directories to search using the--add-python-pathargument.
For instance:scriptmergescripts/blah--add-python-path.>/tmp/blah-standaloneOr to output directly to a file:scriptmergescripts/blah--add-python-path.--output-file/tmp/blah-standaloneYou can also point scriptmerge towards a Python binary that it should use
sys.path from, for instance the Python binary inside a virtualenv:scriptmergescripts/blah--python-binary_virtualenv/bin/python--output-file/tmp/blah-standaloneSscriptmerge cannot automatically detect dynamic imports,
but you can use--add-python-moduleto explicitly include modules:scriptmergescripts/blah--add-python-moduleblah.utilScriptmerge can exclucde modules from be added to output.
This is useful in special cases where is it known that a module is not required to run the methods being used in the output.
An example might be a script that is being used as a LibreOffice macro.
You can use--exclude-python-moduleto explicitly exclude modules.--exclude-python-moduletakes one or more regular expressionsIn this example moduleblahis excluded entirly.blah\.*matches modules such asblah.__init__,blah.my_sub_module.scriptmergescripts/blah--exclude-python-moduleblah\.*By default, scriptmerge will ignore the shebang in the script
and use"#!/usr/bin/env python"in the output file.
To copy the shebang from the original script,
use--copy-shebang:scriptmergescripts/blah--copy-shebang--output-file/tmp/blah-standaloneScritpmerge can strip all doc strings and comments from imported modules using the--cleanoption.scriptmerge--cleanTo see all scriptmerge options:scriptmerge--helpAs you might expect with a program that munges source files, there are a
few caveats:Due to the way that scriptmerge generates the output file, your script
source file should be encoded using UTF-8. If your script doesn't declare
its encoding in its first two lines, then it will be UTF-8 by default
as of Python 3.Your script shouldn't have anyfrom __future__imports.Anything that relies on the specific location of files will probably
no longer work. In other words,__file__probably isn't all that
useful.Any files that aren't imported won't be included. Static data that
might be part of your project, such as other text files or images,
won't be included.CreditsScriptmerge is a fork ofstickytape.Credit goes to Michael Williamson as the original author.
Package: scriptor
ScriptorRun command-line programs in PythonDocumentationSource codeReleasesWhat is it?Scriptor is a high-level library for command-line.
Scriptor makes it easy to integrate other CLI programs to your Python application.Core features:Run programs sync or async using the same syntaxHigh-level program abstractionEasy program parametrizationInstall it from PyPI:pipinstallscriptorWhy Scriptor?Scriptor abstractssubprocessandasyncio.subprocessto the same syntax making it easy to use both of them and
switch between.>>>fromscriptorimportProgram>>>python=Program("python3")>>># Call the program (and wait for finish)>>>python("myscript.py")More ExamplesHere are some examples:>>># Parametrize a script>>>python("myscript.py",report_date="2022-11-11")>>># Use different current working directory>>>python.use(cwd="path/to/dir")("myscript.py")>>># Run script with output (in stdout)>>>python("print_hello.py")'Hello world'>>># Run failing script>>>python("failing.py")Traceback(mostrecentcalllast):...scriptor.process.ProcessError:Traceback(mostrecentcalllast):File"failing.py",line1,in<module>raiseRuntimeError("Oops!")RuntimeError:Oops!Start a process:>>>process=python.start("print_hello.py")>>>process.finishedFalse>>># Wait for the process to finish>>>process.wait()>>># Raise error if process failed>>>process.raise_for_return()>>># Read the results>>>process.read()'Hello world'Some more examples with async:>>># Parametrize a script>>>awaitpython.call_async("myscript.py",report_date="2022-11-11")>>># Run script with output (in stdout)>>>awaitpython.call_async("print_hello.py")'Hello world'Start with async:>>>process=awaitpython.start_async("print_hello.py")>>>process.finishedFalse>>># Wait for the process to finish>>>process.wait()>>># Raise error if process failed>>>process.raise_for_return()>>># Read the results>>>process.read()'Hello world'Change settings ie. the current working directory:>>>git=Program('git')>>>repo_1=git.use(cwd="path/to/repo_1")>>>repo_2=git.use(cwd="path/to/repo_2")>>>repo_1("status")"""On branch mainnothing to commit, working tree clean"""See more from the documentation.If the library helped you, consider buying a coffee for the maintainer â˜•.AuthorMikael Koli-Miksus-koli.mikael@gmail.com
Package: scriptpak
Usage:python -m scriptpak COMMAND [ARGS]Available COMMANDs:run [HOST] [PORT]: Launches the scriptpak server, from ~/scripts/*.sp; if HOST is not given, defaults to 0.0.0.0, if PORT not specified, 8080 will be used, if PORT is not a number, exits with code 1help: Displays this message.vars: Prints all variables from ~/scripts/##vars.ini; exits with code 1 if directory/variables not found or file format is incorrect
Package: script-queue-manager
Script Queue ManagerA small suite of simple CLI tools to queue up scripts to be executed. A simple use case is that of having to repeatedly execute the same scripts with different parameters and each script takes hours to execute. (eg - I personally use it to queue my deep learning training tasks)Installing from pipStable releasepipinstallscript-queue-managerDevelopment releasepipinstall-ihttps://test.pypi.org/simple/script-queue-managerGetting StartedI highly recommend that you fork the project by clicking on theForkbutton and then cloning your fork using the command mentioned below.git clone <your fork URL>PrerequisitesPython 3.5+A code editor or IDE(preferable PyCharm)Setting up for DevelopmentFollow the steps mentioned below to get your dev instance running.After cloning your fork, open the project in an IDE or code editor of you choice.It is highly advisable that you create a new Python environment for the project. Follow the instructions givenhere.Navigate to the project directory and install therequirement.txtpackages.cd <project-directory>
pip install -r requirements.txtBuild the project:python setup.py installUse thepusherto push a script to the task queue.sqm-pusher -s "cat x.txt"Start theexecutortool.sqm-executorIf you want to start it as a background process, in Ubuntu runsqm-executor &Execution ModelThe executor fetches an object from the front of the queue and prepares a script asPRE_SCRIPT + QUEUE_SCRIPT. Here,PRE_SCRIPTcan be given as input to the executor using the flag-pas shown below:sqm-executor-p"path-to-the-file-containing-the-prescripts"The sleeping interval for the executor to sleep in between tasks can be provided using the flag-s. By default it is 15s.
The executor produces logs for every task it executes. The file path for this log file can be provided using the-lflag. By default it is located at$HOME/sqm/logs.txt.TestsNot yet implementedBuilt WithPersistqueue- File based queue.ContributingPlease readCONTRIBUTING.mdfor details on our code of conduct, and the process for submitting pull requests to us.AuthorsMayank Vaidya-Initial workSee also the list ofcontributorswho participated in this project.LicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for details
Package: scripts
ScriptA collection of various shell scripts:pkg: tool to compress files and directories, support several formats (zstd, xz, gz, bz2 with tar, zip...)unpkg: tool to decompress archiveshttpd: a simple http servermyip: find active external ippycclean: remove all backup and python cache filescdblank: clean a rewritable cd/dvdcdriso: generate an iso for a given directorycdwrite: burn an iso filemy-backup: backup all mysql databasespg-backup: backup all postgresql databases
Package: script-scraper-alpha
script-scraper: Intuitive queries for nested scraping tasksWhat is it?script-scraperis a Python package that provides a simple and intuitive
interface, designed to make the web scraping procedure fast and modifiable.
It aims to help developers in writing simple and interpretable bots.script-scraperis built on top of theScrapyframework, providing
the user with a familiar interface.Where to get itThe source code is currently hosted on GitHub at:https://github.com/vlad-yeghiazaryan/script-scraperYou can also install it with pip, by running:pipinstallscript-scraper-alphaWorking examplefromscriptScraper.extractorsimportScriptRunnerrequest={"urls":["https://quotes.toscrape.com"],"extract_rules":{"quotes":{"selector":".quote","type":"list","output":{"text":".text","author":".author","tags":{"selector":".tag","type":"list"},"about":{"selector":"span a","type":"page","follow":"href","output":{"author_name":".author-title","author_birth_date":".author-born-date","author_birth_location":".author-born-location","author_description":".author-description"}}}},"next_page":".next a"}}crawler=ScriptRunner(delay=1,log=False,output='data.json')scraped_data=crawler.scrape(request)
Package: scriptstrap
This is an early prototype of a simple bootstrapping system for python. By
importingscriptstrapinto a python script, a virtual environment (“venv”)
will be automatically created, dependencies installed (usingpip) and the
script will finally be re-launched inside the venv. This simplifies
distribution of small utility scripts, as package dependencies are
automatically manged by just running the script.The intended use case forscriptstrapis single-file utility scripts only!FeaturesAutomatic creation of virtual environment for each scriptDependencies are installed and imported automaticallySimplified script distributionNo additional dependencies other than python and virtualenvRequirementsPython 2.7 or latervirtualenvGetting startedYou must do a global install ofscriptstrapor run it from another
venv. Recommended installation is:$ pip install scriptstrapExampleSimple script that downloads the Google main page and prints it:importscriptstrapscriptstrap.python3('requests')print(requests.get('http://google.com').content)Running the script, assuming the script is calledrequests.py, will create
a new venv in a directory calledrequests.venv3next to the script. If the
script is launched again, the same venv will be re-used.
Package: scripttester
QuickstartProvides class to be instantiated in tests that check that scripts can be run
and give correct output.  Usually works something like this in a test module:import mymodule
from scripttester import ScriptTester
runner = ScriptTester(mymodule)Then, in the tests, something like:code, stdout, stderr = runner.run_command(['my-script', my_arg])
assert code == 0
assert stdout == b'This script ran OK'The class aims to find your scripts whether you have installed (withpip install .orpip install-e.orpython setup.py install), or not.
If you have not installed, the scripts will not be on your system PATH, and we
have to find them.  The heuristic is to look (by default) in the directory
containingmymodule; if there is asetup.pyfile there, and ascriptssub-directory, assume that directory contains the scripts.Note there is no way of using this not-installed mechanism to find entrypoint
scripts, that have not been installed. To find these, we would have to run thesetup.pyfile.Installationpip install scripttesterCodeSeehttps://github.com/matthew-brett/scripttesterReleased under the BSD two-clause license - see the fileLICENSEin the
source distribution.travis-cikindly tests
the code automatically under Python versions 2.7, and 3.3 through 3.6.The latest released version is athttps://pypi.python.org/pypi/scripttesterTestsInstallscripttesterInstall thepytesttesting framework:pip install pytestRun the tests with:py.test --pyargs scripttesterSupportPlease put up issues on thescripttester issue tracker.