Skip to content

pipen

package

pipen

A pipeline framework for python

Provide builting schedulers

Classes
Functions
  • get_scheduler(scheduler) (Type) Get the scheduler by name of the scheduler class itself</>
module

pipen.template

Template adaptor for pipen

Classes
Functions
module

pipen.defaults

Provide some default values/objects

Classes

Provide the PipelinePBar and ProcPBar classes

Classes
module

pipen.pipen

Main entry module, provide the Pipen class

Classes
  • Pipen The Pipen class provides interface to assemble and run the pipeline</>
Functions
  • run(name, starts, data, desc, outdir, profile, **kwargs) (bool) Shortcut to run a pipeline</>
module

pipen.utils

Provide some utilities

Classes
  • RichHandler Subclass of rich.logging.RichHandler, showing log levels as a singlecharacter </>
  • RichConsole A high level console interface.</>
Functions
  • brief_list(blist) (str) Briefly show an integer list, combine the continuous numbers.</>
  • copy_dict(dic, depth) (Mapping) Deep copy a dict</>
  • desc_from_docstring(obj, base) (str) Get the description from docstring</>
  • get_base(klass, abc_base, value, value_getter) (Type) Get the base class where the value was first defined</>
  • get_logger(name, level) (LoggerAdapter) Get the logger by given plugin name</>
  • get_logpanel_width() (int) Get the width of the log content</>
  • get_marked(cls, mark_name, default) (Any) Get the marked value from a proc</>
  • get_mtime(path, dir_depth) (float) Get the modification time of a path.If path is a directory, try to get the last modification time of the contents in the directory at given dir_depth </>
  • get_shebang(script) (str) Get the shebang of the script</>
  • ignore_firstline_dedent(text) (str) Like textwrap.dedent(), but ignore first empty lines</>
  • is_loading_pipeline(*flags, argv) (bool) Check if we are loading the pipeline. Works only whenargv0 is "@pipen" while loading the pipeline. </>
  • is_subclass(obj, cls) (bool) Tell if obj is a subclass of clsDifferences with issubclass is that we don't raise Type error if obj is not a class </>
  • is_valid_name(name) (bool) Check if a name is valid for a proc or pipen</>
  • load_entrypoints(group) (Iterable) Load objects from setuptools entrypoints by given group name</>
  • load_pipeline(obj, argv0, argv1p, **kwargs) (Pipen) Load a pipeline from a Pipen, Proc or ProcGroup object</>
  • log_rich_renderable(renderable, color, logfunc, *args, **kwargs) Log a rich renderable to logger</>
  • make_df_colnames_unique_inplace(thedf) Make the columns of a data frame unique</>
  • mark(**kwargs) (Callable) Mark a class (e.g. Proc) with given kwargs as metadata</>
  • path_is_symlink(path) (bool) Check if a path is a symlink.</>
  • path_symlink_to(src, dst, target_is_directory) Create a symbolic link pointing to src named dst.</>
  • pipen_banner() (RenderableType) The banner for pipen</>
  • strsplit(string, sep, maxsplit, trim) (List) Split the string, with the ability to trim each part.</>
  • truncate_text(text, width, end) (str) Truncate a text not based on words/whitespacesOtherwise, we could use textwrap.shorten. </>
  • update_dict(parent, new, depth) (Mapping) Update the new dict to the parent, but make sure parent does not change</>

Provide exception classes

Classes
module

pipen.version

Provide version of pipen

Process group that contains a set of processes.

It can be easily used to create a pipeline that runs independently or integrated into a larger pipeline.

Runs directly:

>>> proc_group = ProcGroup(<options>)
>>> proc_group.as_pipen(<pipeline options>).set_data(<data>).run()

Integrated into a larger pipeline

>>> proc_group = ProcGroup(<options>)
>>> # proc could be a process within the larger pipeline
>>> proc.requires = prog_group.<proc>

To add a process to the proc group, use the add_proc method:

>>> class MyProcGroup(ProcGroup):
>>>     ...
>>>
>>> proc_group = MyProcGroup(...)
>>> @proc_group.add_proc
>>> class MyProc(Proc):
>>>     ...

Or add a process at runtime:

>>> class MyProcGroup(ProcGroup):
>>>     ...
>>>
>>>     @ProcGroup.add_proc
>>>     def my_proc(self):
>>>         class MyProc(Proc):
>>>             # You may use self.options here
>>>             ...
>>>         return MyProc
>>> proc_group = MyProcGroup(...)

Classes
  • ProcGropuMeta Meta class for ProcGroup</>
  • ProcGroup A group of processes that can be run independently orintegrated into a larger pipeline. </>
module

pipen.proc

Provides the process class: Proc

Classes

Define hooks specifications and provide plugin manager

Classes
Functions
module

pipen.job

Provide the Job class

Classes
  • Job The job for pipen</>
module

pipen.channel

Provide some function for creating and modifying channels (dataframes)

Classes
  • Channel A DataFrame wrapper with creators</>
Functions
  • collapse_files(data, col) (DataFrame) Collapse a Channel according to the files in ,other cols will use the values in row 0. </>
  • expand_dir(data, col, pattern, ftype, sortby, reverse) (DataFrame) Expand a Channel according to the files in ,other cols will keep the same. </>
package

pipen.cli

Provide CLI for pipen