Simple dependent operations library.
Removing %README.org. Added simple example to %README.md.
Adding %README.md because it seems BB doesn't do %.org. Sigh...
Adding %README.org.

heads

tip
browse log

clone

read-only
https://hg.sr.ht/~oofoe/opzed
read/write
ssh://hg@hg.sr.ht/~oofoe/opzed

#Opzed -- A Dependent Operations Library

If you need a simple way to specify and run operations that depend on the results of others, Opzed may be for you. It lets you describe a complicated chain of Tasks, then executes it in a simple and predictable manner with complete logging and error handling.

Unlike something like Paver or Invoke, Opzed is a library to use in your applications to provide a simple processing interface to users. You could do make-style operations with it, but that's not what I wrote it for.

#A Simple Example

People like image processing. So, let's process an image! For the sake of demonstration, I have a full size image (from a camera, perhaps) and I want to make two different versions of it -- a smaller preview image and a thumbnail.

pipeline = (
    dict(name = "Preview", do = "scale", size = "800x800",
	     pin = "photo.jpg", pout = "preview/photo.jpg"),
	dict(name = "Thumb", needs = "Preview", do = "scale", size = "128x128",
	     pout = "thumbnail/photo.jpg"))

This is a Pipeline. It describes two Tasks, Preview and Thumbnail. They both use the same Operation, scale to make a modified copy of the origina image "photo.jpg".

Each Task is specified as a dictionary. Opzed requires the "do" field, which describes the operation to perform. The other fields describe the Task's relationship to others and parameters needed by the operation.

field description
do Operation to perform.
name Name of this Task.
needs Dependencies -- must be finished before this Task.
pin Input file(s).
pout Output file(s).

In the example above, the "scale" field is added to describe the maximum resolutions for each image.