atomate.utils package

Submodules

atomate.utils.database module

atomate.utils.fileio module

class atomate.utils.fileio.FileClient(filesystem=None, private_key='~/.ssh/id_rsa')

Bases: object

A client for performing many file operations while being agnostic of whether those operations are happening locally or via SSH

__init__(filesystem=None, private_key='~/.ssh/id_rsa')
Args:
filesystem (str): remote filesystem, e.g. username@remote_host.

If None, use local

private_key (str): path to the private key file (for remote

connections only). Note: passwordless ssh login must be setup

abspath(path)

return the absolute path

Args:

path (str): path to get absolute string of

copy(src, dest)

Copy from source to destination.

Args:

src (str): source full path dest (str): destination file full path

static exists(sftp, path)

os.path.exists() for paramiko’s SCP object

Args:

sftp (SFTPClient): path (str): path to check existence of

static get_ssh_connection(username, host, private_key)

Connect to the remote host via paramiko using the private key. If the host key is not present it will be added automatically.

Args:

username (str): host (str):

private_key (str): path to private key file

Returns:

SSHClient

glob(path)

return the glob

Args:

path (str): path to glob

listdir(ldir)

Get the directory listing from either the local or remote filesystem.

Args:

ldir (str): full path to the directory

Returns:

iterator of filenames

atomate.utils.testing module

atomate.utils.utils module

Module contents