Python module

Type conversion


Flatten a nested list to a one dimensional list.


Squash a dictionary to a single list.

shelephant.convert.get(data, key)

Get an item from a nested dictionary.


Split a key separated by "/" in a list.

yaml handling

Read YAML file and return its content.

shelephant.yaml.read_item(filename[, key])

Get an item from a YAML file.

shelephant.yaml.dump(filename, data[, force])

Dump data to YAML file.


Print data formatted as YAML.

File operations


Check that all paths point to existing files.


Return list with only the deepest paths.

shelephant.path.dirnames(paths[, return_unique])

Get the os.path.dirname of all file paths.

shelephant.path.makedirs(dirnames[, force])

(Prompt and) Create directories that do not yet exist.

shelephant.path.overwrite(paths[, force])

(Prompt and) List files that will be overwritten if created.

File-path operations

shelephant.relpath.add_prefix(prefix, files)

Add prefix to a list of filenames.

shelephant.relpath.chroot(files, old_root, ...)

Change the root of relative paths.


shelephant.checksum.sha256(filename[, size])

Get sha256 of a file.

shelephant.checksum.get(filepaths[, ...])

Compute the checksums of a list of files.

ssh queries

shelephant.ssh.file_exists(host, source[, ...])

Check if a file exists on a remote system.

scp copy

shelephant.scp.from_remote(host, source, dest)

Copy a file from a remote system.

shelephant.scp.to_remote(host, source, dest)

Copy a file to a remote system.

rsync copy and queries

shelephant.rsync.diff(source_dir, dest_dir, ...)

Check if files are different using rsync.

shelephant.rsync.from_remote(hostname, ...)

Copy files from a remote system.

shelephant.rsync.to_remote(hostname, ...[, ...])

Copy files to a remote system.

Formatted print[theme])

Return dictionary of colors.[, width, align, ...])

Rich string.


Copy with a memory.

  1. Tom de Geus, 2021, MIT