datawork.api.tool

Module implementing Tool and Invocation.

class datawork.api.tool.Tool[source]

A class for composable tools.

This is the base class for configurable functions that transform Data objects.

__call__(*args)[source]

Let a tool act on some Data objects.

Calling a tool instance _invokes_ the tool, which results in an Invocation instance if the arguments are of class Data.

__init__()[source]

Construct an object with a new configuration.

__repr__()[source]

Return the name of the tool and its config.

get_hash()[source]

Return a hash string for this tool and configuration.

static run(cfg)[source]

Compute outputs.

This method is the meat of the Tool class.

version()[source]

Return a version string for this tool.

Subclasses implement their own version methods.

datawork.api.tool.tool(r)[source]

Quickly create a Tool class.

Given a function definition for a tool, create a class with the provided function as the class’s run() method.