LocalPipelineIo

class toasty.pipeline.local_io.LocalPipelineIo(path_prefix)[source]

Bases: PipelineIo

I/O for pipeline processing using the local disk.

Parameters:
path_prefixstr

A path prefix that will be used for all I/O options.

Methods Summary

check_exists(*path)

Test whether an item at the specified path exists.

get_item(*path[, dest])

Fetch a file-like item at the specified path, writing its contents into the specified file-like object dest.

list_items(*path)

List the items contained in the folder at the specified path.

put_item(*path[, source])

Put a file-like item at the specified path, reading its contents from the specified file-like object source.

Methods Documentation

check_exists(*path)[source]

Test whether an item at the specified path exists.

Parameters:
*pathstrings

The path to the item, intepreted as components in a folder hierarchy.

Returns:
A boolean indicating whether the item in question exists.
get_item(*path, dest=None)[source]

Fetch a file-like item at the specified path, writing its contents into the specified file-like object dest.

Parameters:
*pathstrings

The path to the item, intepreted as components in a folder hierarchy.

destwriteable file-like object

The object into which the item’s data will be written as bytes.

Returns:
None.
list_items(*path)[source]

List the items contained in the folder at the specified path.

Parameters:
*pathstrings

The path to the item, intepreted as components in a folder hierarchy.

Returns:
An iterable of (stem, is_folder), where stem is the “basename” of an
item contained within the specified folder and is_folder is a boolean
indicating whether this item appears to be a folder itself.
put_item(*path, source=None)[source]

Put a file-like item at the specified path, reading its contents from the specified file-like object source.

Parameters:
*pathstrings

The path to the item, intepreted as components in a folder hierarchy.

sourcereadable file-like object

The object from which the item’s data will be read, as bytes.

Returns:
None.