API Documentation

Here are the luigo API’s details.

luijo

Extensions for Spotify’s Luigi.

luijo.config

Say something descriptive about the ‘config’ module.

class luijo.config.FileSystem(*args, **kwargs)[source]

Bases: luigi.task.Config

These are configuration settings to which we can refer when working with the local file system.

Variables:target_home_dir – the default home directory for local targets
target_home_dir = <luigi.parameter.Parameter object>
luijo.config.find_configs() → typing.Iterable[str][source]

This function attempts to find the current Luigi :return:

luijo.errors

Something went wrong? It did.

exception luijo.errors.LuijoException(message: str, inner: Exception = None)[source]

Bases: Exception

This is a common base class for all custom luijo exceptions.

__init__(message: str, inner: Exception = None)[source]
Parameters:
  • message – the exception message
  • inner – the exception that caused this exception
args
inner

Get the inner exception that caused this exception. :return: the inner exception

message

Get the exception message. :return: the exception message

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

luijo.mock

Say something descriptive about the ‘testing’ module.

class luijo.mock.MockTask(*args, **kwargs)[source]

Bases: luigi.task.Task

This is a mock task. It has no requirements, performs no actual work, and specifies a luigi.mock.MockTarget as its output. Use it when it might be handy.

output() → luigi.mock.MockTarget[source]

This implementation returns a mock target.

Returns:a mock target
requires()[source]

This task has no requirements.

Returns:an empty iteration
run()[source]

Running the task has no effect.

luijo.targets

Luigi targets, plus just a little more.

class luijo.targets.LocalObjectTarget(path=None, format=None, is_tmp=False)[source]

Bases: luigi.local_target.LocalTarget

This is a local target you can use to serialize a Python object to a file.

deserialize()[source]

Retrieve the target object.

Returns:the target object
serialize(obj, format_: luijo.targets.Serialization = <Serialization.BINARY: 'binary'>)[source]

Serialize an object to the local target.

Parameters:
  • obj – the object you want to serialize
  • format – the serialization format
class luijo.targets.Serialization[source]

Bases: enum.Enum

These are the supported serialization methods.

BINARY = 'binary'
JSON = 'json'
luijo.targets.touch(local_target: luigi.local_target.LocalTarget)[source]

You can use this function to create a local target file in cases where you just need it to signify that the task completed.

Parameters:local_target – the local target