Functions that implement basic functionality that will be used in the library.

Util functions

A set of functions that provide usefull functionality

filter_files[source]

filter_files(files, include=[], exclude=[])

Filter list of files using a list of strings to inculde and/or exclude

ls[source]

ls(x, recursive=False, include=[], exclude=[])

List files in folder, if recursive is True also list subfolders

hdf_attr_check[source]

hdf_attr_check(attr, hdf, default)

Check if attribute is in hdf_attr_dict and return default

dict2json[source]

dict2json(data:dict, file)

Writes json file from dict

Examples:

path = Path('.')
path.ls()
path = Path('.')
path.ls(include=['.ipynb'])
path = Path('.')
path.ls(include=['.ipynb'], exclude=['_checkpoints'])

monthlen[source]

monthlen(year, month)

Gives lenght of the month

year = 2000
month = 2
monthlen(year, month)

class InOutPath[source]

InOutPath(input_path:str, output_path:str, mkdir=True)

Keeps track of an input and a output path. Creates paths if they don't exist and mkdir=True

InOutPath.src[source]

Shortcut to input_path

InOutPath.dst[source]

Shortcut to output_path