vhistfile module

This module contains classes to represent workflow files in a VHIST workflow step. Workflow files can represent any type of data used in or created by a workflow step, e.g. the source code of your python script or program, important config files, input data, generated outputs, log files or other VHIST files. We categorize workflow files into two classes: input files and output files. Input files are all types of files used as input into the workflow. Output files are files generated by your script or program.

You can embed workflow files directly into a VHIST file. This is especially useful for small files, such as logfiles, configuration files or scripts. Larger files are usually only mentioned in the VHIST file (with information about the file size and md5 checksum), as large files inflate the VHIST file’s size immensely.

Attribute Name Description
filename The name of the file (relative or absolute).
purpose States if the file is an input file or an output file. This attribute excepts a FilePurpose object.
description A description of the file’s role within the workflow step.
comment An additional comment about the file.
filetype The type of the file in the form of a MIME type or MIME type-like descriptor. Examples are images/png or binary/ecat7. If you do not specify a filetype (set filetype to None), pyvhist will automatically try to derive a mimetype based on the files extension.
md5file A file, which contains the md5 checksum of a file. Useful only if you do not embed the workflow file inside the VHIST file and already calculated the checksum of the file for some reason.
isPreviewWs Either True or False. If set to True, the file will be displayed as a preview image for the workflow step. Do not use this option directly. Instead use the previews attribute of VhistSection.
isPreview Either True or False. If set to True, the file will be displayed as a preview image for the latest preceeding file, which was not a preview itself. Do not use this option directly. Instead use the previews attribute of VhistFile.
isThumbnail Do not use this option.
isThumbnailOnly Do not use this option.
optional Constitutes if the file is optional or not. Set this option to True if the file might not exist.
automd5 Either True or False. You can set this option to False if you do not embed this file and do not want VHIST to calculate a checksum for the file (for example because the file is too big or you supplied your own md5 sum with the md5file option.
embed Either True or False. If this option is True, the file will be embedded into the VHIST file. Otherwise, the file will only be mentioned in the VHIST file.
compress Either True or False. If compress is set to True, the file will be compressed using the flate compression method and embedded in compressed form.
class pyvhist.vhistfile.FilePurpose(purpose)

The purpose of the file. Either input or output

__init__(purpose)
pyvhist.vhistfile.InFile(filename, description=None, comment=None, filetype=None, md5file=None, isPreviewWs=None, isPreview=None, isThumbnail=None, isThumbnailOnly=None, optional=None, automd5=None, embed=None, compress=None)

Creates the VhistFile object with purpose set to Input File. All other arguments behave just like the arguments of the VhistFile constructor.

pyvhist.vhistfile.OutFile(filename, description=None, comment=None, filetype=None, md5file=None, isPreviewWs=None, isPreview=None, isThumbnail=None, isThumbnailOnly=None, optional=None, automd5=None, embed=None, compress=None)

Creates the VhistFile object with purpose set to Output File. All other arguments behave just like the arguments of the VhistFile constructor.

class pyvhist.vhistfile.VhistFile(filename, purpose, description=None, comment=None, filetype=None, md5file=None, isPreviewWs=None, isPreview=None, isThumbnail=None, isThumbnailOnly=None, optional=None, automd5=None, embed=None, compress=None)

This class represents a vhist workflow file. Each instance of this class can be included in one workflow step (see VhistSection).

__init__(filename, purpose, description=None, comment=None, filetype=None, md5file=None, isPreviewWs=None, isPreview=None, isThumbnail=None, isThumbnailOnly=None, optional=None, automd5=None, embed=None, compress=None)
isInfile()

Returns whether the file is an input file or not.

isOutfile()

Returns whether the file is an output file or not.

filename

The name of the file, including the path

purpose

Whether the file is an input or output file

description

The description of the file

comment

The comment of the file

filetype

The filetype of the file

md5file

The md5 file of the file

isPreviewWs

The isPreviewWs property of the file

isPreview

The isPreview property of the file

isThumbnail

The isThumbnail property of the file

isThumbnailOnly

The isThumbnailOnly property of the file

optional

The optional property of the file

automd5

The automd5 property of the file

embed

The embed property of the file

compress

The compress property of the file

userAttrs

A dictionary of key-value pairs

Previous topic

vhistsection module

Next topic

vhistblock module

This Page