files
Functions
abspath(path: str) → strParameters
path: str
annotateDir(app: Any, tool: str) → tuple[(str, str)]Return the input and output and report directories for a specific annotation tool.
Parameters
app: Anytool: str
backendRep(be: str | None, kind: str, default: str | None = None) → str | NoneVarious back-end dependent values.
Parameters
be: str | Nonekind: strdefault: str | None= None
chDir(directory: str) → NoneChange to other directory.
Parameters
directory: str
clearTree(path: str) → NoneRemove all files from a directory, recursively, but leave subdirectories.
Parameters
path: str
dirAllFiles(path: str, ignore: set[str] | None = None) → list[str] | tuple[(str, ...)]Gets all the files found by `path`.
Parameters
path: strignore: set[str] | None= None
dirContents(path: str) → tuple[(tuple[(str, ...)], tuple[(str, ...)])]Gets the contents of a directory.
Parameters
path: str
dirCopy(pathSrc: str, pathDst: str, noclobber: bool = False) → boolCopies a directory if it exists as directory.
Parameters
pathSrc: strpathDst: strnoclobber: bool= False
dirEmpty(target: str) → boolParameters
target: str
dirExists(path: str | None) → boolWhether a path exists as directory on the file system.
Parameters
path: str | None
dirMake(path: str) → NoneCreates a directory if it does not already exist as directory.
Parameters
path: str
dirMove(pathSrc: str, pathDst: str) → boolMoves a directory if it exists as directory.
Parameters
pathSrc: strpathDst: str
dirNm(path: str) → strGet the directory part of a file name.
Parameters
path: str
dirRemove(path: str) → NoneRemoves a directory if it exists as directory.
Parameters
path: str
expandDir(obj: Any, dirName: str) → strParameters
obj: AnydirName: str
expanduser(path: str) → strParameters
path: str
extNm(path: str) → strGet the extension part of a file name.
Parameters
path: str
fileCopy(pathSrc: str, pathDst: str) → NoneCopies a file if it exists as file.
Parameters
pathSrc: strpathDst: str
fileCopyExpr(dirSrc: str, dirDst: str) → NoneCopies the `__checkout__.txt` file from one directory to an other.
Parameters
dirSrc: strdirDst: str
fileExists(path: str) → boolWhether a path exists as file on the file system.
Parameters
path: str
fileMake(path: str, force: bool = False) → NoneCreate a new empty file.
Parameters
path: strforce: bool= False
fileMove(pathSrc: str, pathDst: str) → NoneMoves a file if it exists as file.
Parameters
pathSrc: strpathDst: str
fileNm(path: str) → strGet the file part of a file name.
Parameters
path: str
fileOpen(args: Any = (), kwargs: Any = {}) → TextIO | BinaryIOWrapper around `open()`, making sure `encoding="utf8" is passed.
Parameters
args: Any= ()kwargs: Any= {}
fileRemove(path: str) → NoneRemoves a file if it exists as file.
Parameters
path: str
getCwd() → strGet current directory.
getLocation(targetDir: str | None = None) → tuple[(str | None, str | None, str | None, str | None)]Get back-end, org, repo, relative of directory.
Parameters
targetDir: str | None= None
initTree(path: str, fresh: bool = False, gentle: bool = False) → NoneMake sure a directory exists, optionally clean it.
Parameters
path: strfresh: bool= Falsegentle: bool= False
isDir(path: str) → boolWhether path exists and is a directory.
Parameters
path: str
isFile(path: str) → boolWhether path exists and is a file.
Parameters
path: str
normpath(path: str | None) → str | NoneParameters
path: str | None
prefixSlash(path: str) → strPrefix a / before a path if it is non-empty and not already starts with it.
Parameters
path: str
readJson(text: str | None = None, plain: bool = False, asFile: str | TextIO | None = None, preferTuples: bool = False) → dict[(str, Any)] | AttrDictRead a JSON file or string.
Parameters
text: str | None= Noneplain: bool= FalseasFile: str | TextIO | None= NonepreferTuples: bool= False
readYaml(text: str | None = None, plain: bool = False, asFile: str | TextIO | None = None, preferTuples: bool = True, preferLists: bool = True) → dict[(str, Any)] | AttrDict | NoneRead a YAML file or string.
Parameters
text: str | None= Noneplain: bool= FalseasFile: str | TextIO | None= NonepreferTuples: bool= TruepreferLists: bool= True
replaceExt(path: str, newExt: str) → strReplace the extension of a path by another one. Specify it without dot.
Parameters
path: strnewExt: str
setDir(obj: Any) → NoneParameters
obj: Any
splitPath(path: str) → tuple[(str, str)]Split a file name in a directory part and a file part.
Parameters
path: str
str_presenter(dumper, data: str)configures yaml for dumping multiline strings Ref: https://stackoverflow.com/questions/8640959
Parameters
dumperdata: str
stripExt(path: str) → strStrip the extension of a file name, if there is one.
Parameters
path: str
unexpanduser(path: str) → strParameters
path: str
writeJson(data: Any, asFile: str | TextIO | None = None, kwargs: Any = {}) → str | NoneWrite data as JSON.
Parameters
data: AnyasFile: str | TextIO | None= Nonekwargs: Any= {}
writeYaml(data: Any, asFile: str | TextIO | None = None, sorted: bool = False) → str | NoneWrite data as YAML.
Parameters
data: AnyasFile: str | TextIO | None= Nonesorted: bool= False