A framework for batch processing.
Project description
Commando
Commando is a framework for batch processing.
コマンドラインツールを脳筋で実行していくバッチ処理のためのフレームワーク。 基本的にPythonの構文でワークフローを構築できるので、バッチ処理での変数の取り回しなどがしやすいのがメリット。
Shell Script や Bat ファイルを書かなくても実行したいコマンドさえわかっていればバッチ処理が書ける。
Concept
- バッチ処理ワークフローを構築するためのフレームワーク
- 逐次処理で書く
- 外部コマンドに関しては subprocess.run()が走る
Feature
add()
- add command
execute():
- Execute the added command.
- Process them in the order they were added.
- Functions can also be executed as commands
Usage
install
pip install pycommando
script
import logging
from commando import commando
logging.basicConfig(filename="test.log", level=logging.DEBUG)
def zero():
1 / 0
commando.add("mkdir test")
commando.add("touch test\\test.txt")
commando.add(zero)
commando.execute()
log
DEBUG:commando.commando:mkdir test
DEBUG:commando.commando:touch test\test.txt
DEBUG:commando.commando:<function zero at 0x01A177C0>
ERROR:commando.commando:Could not execute function
Traceback (most recent call last):
File "C:\Users\takum\dev\pydev\commando\commando\commando.py", line 29, in execute
cmd()
File "main.py", line 9, in zero
1 / 0
ZeroDivisionError: division by zero
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pycommando-0.2.0.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for pycommando-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2d9315b52883e588f7ff57a32defcae0d3a90ec091818ae29dfa34266dd1a9f |
|
MD5 | 81cb27d2798063bd922de980ad04f2d4 |
|
BLAKE2b-256 | d584374007a38ebbfc0a908e645d9679fd67b239a4692109b9273d28db3bd485 |