Skip to main content

A framework for batch processing.

Project description

Commando

Commando is a framework for batch processing.

コマンドラインツールを脳筋で実行していくバッチ処理のためのフレームワーク。 基本的にPythonの構文でワークフローを構築できるので、バッチ処理での変数の取り回しなどがしやすいのがメリット。

Shell Script や Bat ファイルを書かなくても実行したいコマンドさえわかっていればバッチ処理が書ける。

コンセプト

  • バッチ処理ワークフローを構築するためのフレームワーク
  • 逐次処理で書く
  • 外部コマンドに関しては subprocess.run()が走る

Feature

  • add()でコマンド追加
  • 追加された順に処理する
  • execute() で追加されたコマンドの実行
  • 関数もコマンドとして実行できる

課題

  • エラーハンドリングとかどうする?
    • エラーがあればすぐに落とす仕様にする???

Usage

 import os
 
 from commando import commando
 
 
 def myprint():
     print("コマンドー")

 
 # コマンド文字列
 commando.add("mkdir test")
 # リスト形式のコマンド
 commando.add(["touch", "test\\test.txt"])

 # 独自定義の関数
 commando.add(myprint)
 
 # 追加した順でコマンドを実行
 commando.execute()

Project details


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.1.1.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

pycommando-0.1.1-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page