Skip to main content

This small library provide an easy way to run some tasks in batch and track progress on the CLI.

An example of output you can get is the following:

[ 1/7 ] Put oil in the pan
[ ... ] ...
[ 2/7 ] Turn fire on
[ ... ] ...
[ 3/7 ] Break the egg
[ ... ] ...
[ 4/7 ] Put the egg in the pan
[ ... ] ...
[ 5/7 ] Wait the egg is cooked
[ ... ] ...
[ 6/7 ] Put the egg in the dish
[ ... ] ...
[ 7/7 ] Add salt to the egg and eat it!
[ ... ] ...

The module provide an api to define tasks and add them to a task engine:

cli = SimpleCli()
engine = TaskEngine(cli)

engine.addTask(Print("Put oil in the pan"))
engine.addTask(Print("Turn fire on"))
engine.addTask(Print("Break the egg"))
engine.addTask(Print("Put the egg in the pan"))
engine.addTask(Print("Wait the egg is cooked"))
engine.addTask(Print("Put the egg in the dish"))
engine.addTask(Print("Add salt to the egg and eat it!"))

engine.run()

In the example above Print is a class extending Task (defined in the module):

class Print(Task):
   "Simple Task: do nothing more than printing ..."

   def run(self, cli):
       cli.newMessage

In case a task fails the task engine stops immediately and return from the method run.

Release files for batchcli 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for batchcli 0.2
File Size Uploaded
batchcli-0.2.tar.gz 5.4 kB Details

Release files / batchcli-0.2.tar.gz

Download URL batchcli-0.2.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0d23259691b08483060be3750243cc951fd64918794aaae87ceb7df760f9b5a2
BLAKE2b-256 checksum
How to use checksums
798d682ebb6afc4d9901987adb8d38b925988afa4c84c9a790004f4f73328347
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page