Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mariocesar/runner.py
Run, Attach, Schedule, Repeat, Chain and React to commands.
https://github.com/mariocesar/runner.py
python python3
Last synced: 3 days ago
JSON representation
Run, Attach, Schedule, Repeat, Chain and React to commands.
- Host: GitHub
- URL: https://github.com/mariocesar/runner.py
- Owner: mariocesar
- License: mit
- Created: 2018-04-08T01:59:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-09T04:12:48.000Z (over 6 years ago)
- Last Synced: 2024-12-08T23:48:44.747Z (26 days ago)
- Topics: python, python3
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
runner.py Run, Attach, Schedule, Repeat, Chain and React to commands.
.. image:: https://badge.fury.io/py/run.py.svg
:target: https://pypi.org/project/runner.py/.. image:: https://travis-ci.org/mariocesar/run.py.svg?branch=master
:target: https://travis-ci.org/mariocesar/run.pyInstall and Use
---------------Install with pip.
.. code-block:: console
pip install runner.py
A simple example on how to use it.
.. code-block:: python
import asyncio
from runnerpy.runner import Runner
if __name__ == '__main__':
loop = asyncio.get_event_loop()runner = Runner(loop)
runner.run('python manage.py runserver')
runner.run('celery -A project worker -l INFO')runner.start()
Now a Django app will run along the celery worker. Hit ctrl+c to stop both.
Some examples:
.. code-block:: python
import asyncio
from runnerpy.runner import Runner
if __name__ == '__main__':
loop = asyncio.get_event_loop()runner = Runner(loop)
runner.run('cp -ar dist/static public/static')
runner.run('pg_dump --all')runner.start()
::Follow updates in log, stop when `apt update` finish
.. code-block:: python
import asyncio
from runnerpy.runner import Runner
if __name__ == '__main__':
loop = asyncio.get_event_loop()runner = Runner(loop)
runner.run('sudo apt update', essential=True)
runner.run('tail -f /var/log/syslog)runner.start()
::