package

pipen_filters

Add a set of useful filters for pipen templates

Classes

Provides the filters

Functions
  • add_filter(aliases) (Callable) Add a filter to the FILTERS</>
  • as_path(pth) (Path) Convert a path to a Path object</>
  • basename(pth) (str) Get the basename of a path</>
  • commonprefix(*paths, basename_only) (str) Get the common prefix of a set of paths</>
  • config(x, loader) (Mapping) Get the configuration (python dictionary) from a file</>
  • dirname(pth) (str) Get the directory name of a path</>
  • exists(pth) (bool) Check if a path exists</>
  • ext(pth, ignore, recursive) (str) Get the extension of a file</>
  • ext0(pth, ignore, recursive) (str) Get the extension of a file without the leading dot</>
  • filename(pth, ignore, recursive) (str) Get the filename of a file.</>
  • filename0(pth, ignore, recursive) (str) Get the filename of a file without the extension</>
  • getatime(pth) (int) Get the access time of a file, return -1 if the file does not exist</>
  • getctime(pth) (int) Get the creation time of a file, return -1 if the file does not exist</>
  • getmtime(pth) (int) Get the modification time of a file, return -1 if the file does not exist</>
  • getsize(pth) (int) Get the size of a file, return -1 if the file does not exist</>
  • glob(*paths) (List) Glob a path</>
  • glob0(*paths) (str) Glob a path and return the first result</>
  • isdir(pth) (bool) Check if a path is a directory</>
  • isempty(pth, ignore_ws, nonfile_as_empty) (bool) Check if a file is empty</>
  • isfile(pth) (bool) Check if a path is a file</>
  • islink(pth) (bool) Check if a path is a symlink</>
  • joinpaths(*paths) (str) Join paths.</>
  • json_dumps(var) (str) Dump an object to json.</>
  • json_load(pth) (Any) Load a json file</>
  • json_loads(jsonstr) (Any) Load a json string to an object</>
  • prefix(pth, ignore, recursive) (str) Get the prefix of a file</>
  • prefix0(pth, ignore, recursive) (str) Get the prefix of a file without the extension</>
  • quote(var) (str) Quote a string</>
  • read(file, *args, **kwargs) (Union) Read the contents from a file</>
  • readlines(file, *args, **kwargs) (Union) Read the lines from a file</>
  • readlink(pth) (str) Get the link of a symlink</>
  • realpath(pth) (str) Get the real path of a path</>
  • regex_replace(string, pattern, repl, count, flags) (str) Replace the matched pattern with a string</>
  • slugify(string, *args, **kwargs) (str) Slugify a string</>
  • squote(var) (str) Quote a string with single quotes</>
  • toml(var) (str) Dump an object to toml.</>
  • toml_load(pth) (Any) Load a toml file. null will be loaded as None</>
  • toml_loads(tomlstr) (Any) Load a toml string to an object, null will be loaded as None</>