Saravanan666/pypi-org huggingface dataset:
Package: run-all-the-tests
Run a series of test invocation making sure each test case works with both 'pytest' and
'python -m pytest' over all working directories between the project root and the directory
containing the test script.├─ src
│
│<-- # run selected __main__'s from this working directory
│
│  └─ __init__.py
│  └─ foo.py
│  ├─ bar
│  │   └─ __init__.py
│  │   └─ bar.py
│  │
│  │<-- # run selected __main__'s from this working directory
│  │
│  └─ run_foo_main.py
│  └─ run_bar_main.py
│
│<-- # run selected test cases from this working directory
│
├─ tests
│  │
│  │<-- # run selected test cases from this working directory
│  │
│  └─ test_foo.py
│  └─ bar
│        │<-- # run selected bar test cases from this working directory
│        │
│        └─ test_bar.py
└─ setup.pyYourrun_all_my_tests.py:from run_all_the_tests import TestCasePath, TestCase, Group, TestType

if __name__ == '__main__': 
    project_path: PurePath = Path(__file__).absolute().parent.parent


    def gen_test_case_path(test_case: str) -> TestCasePath:
        return TestCasePath(project_path, PurePath(test_case))


    all_test_cases: Tuple[TestCase, ...] = (
        TestCase.gen_test_case(gen_test_case_path('tests/test_foo.py')),
        TestCase.gen_test_case(gen_test_case_path('tests/bar/test_bar.py')),
    )

    run_all_tests(all_test_cases)Each set of tests are run in parallel withinGroup.ONE. Designate
tests to run within non-conflicting groups of parallel runs by assigning
all test cases that can run without conflict to the sameGroup.all_test_cases: Tuple[TestCase, ...] = (
        TestCase.gen_test_case(gen_test_case_path('tests/test_foo.py')),
        TestCase.gen_test_case(gen_test_case_path('tests/bar/test_bar.py'), Group.TWO),
    )TestCase.gen_test_case()also supports the following agrs:pytest_filter: str = None
    :param pytest_filter: pytest -k string
 
    test_types: Tuple[TestType, ...] = TestType.all_test_types()
    :param test_types: for exceptional situations, limit a TestCase to run for limited set of TestType's
Package: runandcliscaffold
runandcliscaffoldLightweight library for use of defining functions and parameters that can be called from CLI or from other functionsClasses can now be defined in a simpler format that focus on business logic while enabling content for CLI running OR being called as a scriptFor example, a class definition:from runandcliscaffold import RunAndCliScaffold

class fakeImplementation(RunAndCliScaffold):
    def __init__(self):
        super().__init__("TESTING")

    def hello(self, args):
        ret = f"{args.greeting}, {args.name}!"
        print(ret)
        return ret

    def goodbye(self, args):
        ret = f"{args.greeting}, {args.name}!"
        print(ret)
        return ret

    def _defineFunctionsWithArgs(self):
        return {self.hello: [{"short": "n", "long": "name", "default": "Tj", "type": str,
                             "help": "test1: beginning of data collection time period"},
                            {"short": "g", "long": "greeting", "default": "Hello", "type": str, "required": False,
                             "help": "greeting to use"}
                        ],
                self.goodbye: [{"short": "n", "long": "name", "default": "Tj", "type": str,
                           "help": "test1: beginning of data collection time period"},
                          {"short": "g", "long": "greeting", "default": "Goodbye", "type": str, "required": False,
                           "help": "greeting to use"}
                          ],
        }can be called through command line:python myscript.py hello -n Mark -g Wassupand returns:Wassup, Mark!the equivelant call from script:testclass = fakeImplementation()
ret = testclass.run(['hello', '--g', 'Wassup', '--n', 'Mark'])also returns the value:Wassup, MarkWhile enabling an app to be run out as CLI, this also has usage as a test mechanism or as a self contained unit for consumption of other scripts.
Package: runapp
in yaml formatHome-page: https://github.com/Kostanos/runAuthor: Kostya KostyushkoAuthor-email: kostanos@gmail.comLicense: MITDescription: runapp------Allows to build and/or run your application using simple config filein yaml formatCommonly used in deploys, dockers etc.using-----run:.. code-block:: bashrunapp [<atributes>]inside the folder with **run.yaml** configuration filesee also **runapp --help**run.yaml example:#################.. code-block:: yamlbuild:commands:- pip install -r ./configs/requirements.${ENV}.txtrun:maxRepeats: 5repeatDelay: 1commands:- gunicorn manage:app -c ./configs/gunicorn.${ENV}.pyKeywords: simple run build application configurationPlatform: UNKNOWNClassifier: Development Status :: 3 - AlphaClassifier: Intended Audience :: DevelopersClassifier: Topic :: Software Development :: Build ToolsClassifier: License :: OSI Approved :: MIT LicenseClassifier: Programming Language :: Python :: 2Classifier: Programming Language :: Python :: 2.6Classifier: Programming Language :: Python :: 2.7Classifier: Programming Language :: Python :: 3Classifier: Programming Language :: Python :: 3.3Classifier: Programming Language :: Python :: 3.4Classifier: Programming Language :: Python :: 3.5
Package: run-as-admin
run-as-adminIntroductionThis script provides a simple way to execute a file as an administrator on Windows systems. It utilizes theRunAsAdminclass to handle the execution and logging of commands. By running a file as an administrator, it bypasses the usual User Account Control (UAC) prompts.InstallationYou can install run-as-admin via pip:pipinstallrun-as-adminExample UsageInstallimportosfromrun_as_adminimportRunAsAdmin# Define the file path of the executablefile_path="C:\Windows\System32\cmd.exe"# Replace this with the actual file path# Define the path for the log filelog_file_path=os.path.join(os.getcwd(),"execution_log.log")# Create a RunAsAdmin instancerunner=RunAsAdmin(file_path,True,log_file_path)# Execute the file as administratorrunner.execute()Parametersfile_path(str): The path to the executable file you want to run.logging(bool): Set toTrueif you want to keep log,Falseotherwise.log_file_path(str, optional): The path to the log file where execution details will be saved. If not specified,execution_log.logfile will be created in current directory.ReminderIf you do not want the UAC prompt to appear when executing the file, you can adjust the User Account Control settings. However, it's important to note that disabling UAC entirely for administrators can pose security risks.Local Security PolicyIn the Local Security Policy settings, navigate to:SecuritySettings->LocalPolicies->SecurityOptionsAdjust the behavior of the User Account Control: Run all administrators in Admin Approval Mode. Disabling this policy will effectively disable UAC for administrators, but it's not recommended for security reasons.DependenciesPython 3.xWindows operating systemLicenseCopyright (c) 2024 Barno ChakrabortyPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: runat
Runat: A Tiny Replacement for CrontabWelcome to Runat, a CLI tool that offers a simple and efficient way to replace crontab. It provides a reliable solution for various use cases, including running it inside containers, when crontab is broken, for security compliance, and anything else you may need.InstallationRunat is easy to install via pip. You can install it using the following command:pip install runatOptionsTo learn more about Runat's options, you can typerunat --help. The following optional arguments are available:Usage: runat [OPTIONS]

  A tiny replacement for cron for different usages.

  Args:     cron (str): Cron-like syntax string.     do_ (str): List of
  command or shell script.

Options:
  -c, --cron TEXT  Cron like syntax "22 23 * * *"  [required]
  -d, --do TEXT    List of command or shell script  [required]
  --help           Show this message and exit.UsageHere's how you can use Runat:runat --cron "01 23 * * *"  --do "cd /srv/;bash cleanTemp.sh | tee  -a /var/log/cleanTemp.log"Example OutputHere's an example of what Runat's output might look like:runat --cron "01 23 * * *"  --do "cd /srv/;bash cleanTemp.sh | tee  -a /var/log/cleanTemp.log"
> The next run  in 23.0 hours, 59.0 minutes, 56.0 secondsInstallation via PyPITo install Runat via PyPI, simply run the following command:pip install runatDevelopmentRunat includes a number of helpers in theMakefileto streamline common development tasks. You can set up your development environment using the following steps:### create a virtualenv for development
$ make virtualenv

$ source env/bin/activate

### run runat cli application
$ runat --helpDeploymentsDockerNoteIf you want to work on local file, you should mount it to the container using-v.To build and distribute Runat using Docker, you can use the following commands:$ make docker

$ docker run -it runat --helpLicenseRunat is licensed under the GNU GENERAL PUBLIC LICENSE.Author InformationThe tool was originally developed byAli Saleh Baker.
Package: runbook
runbook.py (v0.2)pip3 install runbookInspired bythis blog postby Dan Slimmon.Define your own run-book in a class extending fromRunbook. Every method that
doesn't begin with an underscore is read in as a step to be completed, in order.
The step name will be built from the method name, and the description is taken
either from the method's own docstring or from any data returned from invoking
the method.fromrunbookimportRunbookclassCustomRunbook(Runbook):deffirst_step(self):"""Do ABC now."""defsecond_step():"""Do EFG then wait 1 hour."""defthird_step():task="reboot"returnf"perform a{task}"@staticmethoddeflast_step():"""Everything ok?"""EveryRunbookobject comes with a default main method that you can use to execute the script.if__name__=='__main__':CustomRunbook.main()The run-book object can also be instantiated and run directly.book=CustomRunbook(file_path="path/to/file")book.run()You should avoid using the step namesrunandmain, which are already defined. If you need to override these
methods to define custom behavior then that is fine.As steps are completed, the results are written out to a log file. You can set a custom log file path by passing
an argument to main, as in:python3 my_runbook.py output.logWhen reusing the same log file, already completed steps will be skipped. Any new steps found in theRunbookand not already in the log will be processed as normal, with results appended to the end of the file.LicenseLicensed under the Apache Software License 2.0 (ASL 2.0).
Package: runbullet
Runbullet=========Execute any command or custom complex logic on your devices, wherever they are, using your PushBullet account.Installation------------```shellpip install runbullet```Configuration-------------Copy /etc/runbullet/config.example.yaml to /etc/runbullet/config.yaml (system-wise settings) or ~/.config/runbullet/config.yaml (user-wise settings).Edit the file to include:* Your PushBullet access token (create one [here](https://www.pushbullet.com/#settings/account));* The name of the (virtual) PushBullet device used to listen for events (create one [here](https://www.pushbullet.com/#devices)).Each target device is identified by a unique device_id in the messages sent over your account. The device_id is the hostname by default, unless changed in config.yaml.Testing-------`runbullet` installs `pusher`, a command-line tool to send PushBullet messages to the connected devices in the format used by runbullet.Some examples:```shellecho '{"cmd":"scp /home/user/photos/*.jpg backup_host:/mnt/hd/photos"}' | pusher --target laptop --plugin shellecho '{"play":true}' | pusher --target raspberrypi --plugin music.mpd```Writing your plugins--------------------Writing your own `runbullet` plugin, that would execute your own custom logic whenever a bullet with your plugin name is received, is a very simple task.1. Create your plugin directory under `runbullet/plugins` (e.g. `light/batsignal`).2. In the case above, `runbullet.plugins.light.batsignal` will be your package name.3. Create an `__init__.py` under `runbullet/plugins/light/batsignal`.4. If your module is `light/batsignal`, then its main class should be named `LightBatsignalPlugin`.5. The configuration for your module will be read from a section named `light.batsignal` from your `config.yaml`, the attributes are accessible in your class in `self.config`.The `__init__.py` will look like this:```pythonfrom .. import LightPluginclass LightBatsignalPlugin(LightPlugin):def _init(self):self.batsignal = batsignal.Batsignal(self.config['intensity'])def on(self):self.batsignal.on()def off(self):self.batsignal.off()def toggle(self):self.batsignal.toggle()def status(self):return [self.batsignal.status().stdout, self.batsignal.status().stderr]```6. It's a good practice to define a `status` method in your plugin, which returns a 2-items list like `[output, error]`.7. Rebuild and reinstall `runbullet` if required and relaunch it.8. Test your new plugin by sending some bullets to it:```shellecho '{"on":true}' | pusher --target your_pc --plugin light.batsignal```
Package: run-by-arch
run-by-archhelps you organize and run programs compiled for varying operating systems and CPU target architectures.Installationrun-by-archis a Python program that works with both Python 2 and 3. You can install it withpip installrun-by-arch.run-by-archdoes not depend on any other Python packages, so it is safe to install it into your system Python.Why do I need run-by-arch?For example, if you are working on a program calledmy-programwith binaries stored on a Network File System instance shared between 64-bit Linux and MacOS users, then users of both
operating systems can runrun-by-archmy-programfollowed by the arguments for that program.For a Linux user,run-by-archwill run the binary found at the directory./run-by-arch/linux-x86_64/my-program.For a MacOS user,run-by-archwill run the binary found at./run-by-arch/darwin-x86_64/my-program.If you set the environment variableRUN_BY_ARCH_PREFIX, you can tellrun-by-archto look anywhere else on your filesystem.run-by-archexpects the path atRUN_BY_ARCH_PREFIXto have subdirectories named after the operating system hyphenated with the CPU architecture. If you setRUN_BY_ARCH_PREFIX=/prefix, then your binaries should be located at:/prefix/darwin-x86_64/for 64-bit MacOS computers with Intel CPUs (not the Apple M1)/prefix/linux-x86_64/for 64-bit Linux computers/prefix/windows-x86_64/for 64-bit Windows computers/prefix/linux-i386/for 32-bit Linux computers…and so on…
Package: runchecked
Run CheckedI ran into the struggle, that when running backups via cron I was never quite sure if they succeeded.
Sure, I could rely on the cron error mails, but those are not generated when host is down entirely.
On my journey to a solution I stumbled across a nice tool calledHealthchecks.io.
It does two things: Alerting when the cron job fails and when the corn job was not executed according to its schedule.First, I tried wrapping my more complex backup scripts into bash scripts - monitoring the exit code of commands and piping stdout into a variable to maintain the log in Healthchecks.
However, this proved to be quite difficult. Thus I wrote a small Python script to wrap my commands, gather stdout and stderr, and finally report everything back the my Healthchecks instance.How to useThis is no ready-made script. It is rather intended to be used as a library, to provide quick utility functions.fromruncheckedimportHealthCheckedContextwithHealthCheckedContext("...Your Healthchecks ping-back url here...",working_dir=".",# Optionally set the general working directoryenable_tty_output=None,# Explicitly activate or deactive the echo to stdout. When left to None, it tries auto-detecting if the shell session is interactive)asctx:# Log some infosctx.log.info("Backup started")# Set some environment variables global to the contextctx.set_env("Hello","World")# Get the environment variablectx.log.debug("Hello%s",ctx.get_env("Hello"))# Run some commandsreturn_code=ctx.run(["ls","-alh","."],# commands are passed in the same way as in Python's `subprocess` libraryallow_fail=False,# When true the context is not terminated, if the program exits with anything but 0timeout=None,# Optional time for the program in secondspass_env=True,# If False only the system environment variables are passed, but not the context ones)LicenseMIT License(c) Martin PetersakaFreakyBytes
Package: runcible
# Runcible[![Documentation Status](https://readthedocs.org/projects/runcible/badge/?version=latest)](https://runcible.readthedocs.io/en/latest/?badge=latest)
[![Gitter](https://badges.gitter.im/runcible_project/community.svg)](https://gitter.im/runcible_project/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)##What is Runcible?
Runcible is a framework and CLI application to allow for declarative switch management. It intakes a declared state for
a device in YAML or JSON and turns it into a list of idempotent commands to configure that device, it then runs them
over the desired protocol.Runcible provides a high-level API for Python developers to leverage to manage devices programmatically, and also
provides a YAML interface with configuration layering and inheritance for network engineers with any amount of
programming experience.##How is This Different from Ansible and Others?
Runcible was created to solve three major problems in regards to Network Automation:###Interface Commonality
One of the core components of Runcible is a datatype known as Modules. Modules are plugin-independent interfaces that
allow data with a common schema to be passed into multiple types of plugins. This allows for a large amount of
configuration re-use between similar devices produced by different vendors. I.E. the vlans module should be implemented
by any switch plugin that supports vlans, and the configuration should be identical (assuming the device supports the
entire featureset of the vlans module.)###Topology Awareness
One important aspect of any kind of network automation is ensuring that bad automation runs are dealt with, and that
you stage your changes in a topology-aware manner. You wouldn’t want a bad change to propagate to your entire core
switch fabric and take your network down. Runcible provides Schedulers that allow for intelligent automation runs allow
you to ensure that your automated changes are made intelligently, and also control rollback and failure behavior.###Protocol Agnosticism
Runcible doesn’t operate on a defined set of protocols. While most providers will go with a text based protocol
(SSH, telnet, RS232), any protocol is supported. Runcible provides some sane default protocol modules based on paramiko
for SSH, and pyserial for RS232 terminals, but has loose shim classes that allow plugin writers to implement any
protocol they deem necessary without inhibiting any of Runcible’s features. This allows users to use their same
automation repository for both bootstrapping devices via a serial connection, as well as making changes via SSH,
Telnet, REST, or even protocols that haven’t been invented yet.## Getting StartedRead the getting started guide here:https://runcible.readthedocs.io/en/development/getting_started.html
Package: runcitadel
runcitadelA package for developing and running citadel simulations.Installation$pipinstallruncitadelUsageruncitadelcan be used to connect a local simulation to a citadel session to perform
interactive computation on graphs. For usage examples, see the examples notebook in /docs/.ContributingInterested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.Licenseruncitadelwas created by Miles van der Lely. It is licensed under the terms of the MIT license.Creditsruncitadelwas created withcookiecutterand thepy-pkgs-cookiecuttertemplate.Developed in the Visualisation Lab at the University of Amsterdam (UvA).
Package: runcli
Run commands for your repo, easily.runcliallows you to define aRunfileat the root of your
repository, and then call that file from anywhere in your repo as a
script using the commandrun. The rest is up to you!Seethe github repofor the
source code.InstallationInstallruncliwithpip:pip install runcliCurrently only linux is tested, but it should also work on Mac.QuickstartTo userun, first write aRunfilein the root of some
repository. TheRunfileis just a script, and can be any script you
like, for example:#! /bin/bash

echo $1Then, from anywhere in your repository call theRunfilescript using
theruncommand:> run "hello, world!"
hello, world!That’s all there is to it.ContributingPull requests are welcome. All contributions should happen onthe github repo.
Package: runclock
run-clockWith this little library you can set time for running your code.Usage:run_at():This function takes 3 arguments in string type:hourminutesecondFor example, we have a script that we want to run at11:30:00:fromrunclockimportrun_atrun_at(11,30,0)print('time to run !')And at11:30:00, it will print the text.The defaule value for minute and second is 0 , so you can skip giving minute or second argument:run_at(11)print('Hi')It will print the text at11:00:00orrun_at(11,30)It will print the text at11:30:00Installation:You can install with pip:pip3 install runclockor install from source:git clone https://github.com/Ali-Hosseinverdi/run-clock
cd run-clock
python3 setup.py
Package: runcmd
Installation$[sudo]pipinstallruncmdExamples>>>importruncmd>>>r=runcmd.run(["echo","hello world"])>>>r.code# exit status code0>>>r.out# stdout'hello world'>>>r.err# stderr''>>>r.pid# process pid1234background=True>>>r=runcmd.run(["sleep","5"],background=True)>>>whiler.running:# True if process is running and not "zombie process">>>print("running")kill(signal=None)- kill process>>>r.kill(-9)exc()- raise exception if code is not0>>>runcmd.run(["ls"]).exc()# code 0, ok>>>runcmd.run(["mkdir","/"]).exc()# code 1, raise OSError...OSError:exitedwithcode1mkdir:/:Isadirectoryreadme42.com