Api Documentation

This section contains more granular documentation of the classes and functions available to the api.

Automated Runner

class Runner(path, *, filesystem=None)[source]

This class handles orchestration of downloading and storing the backup. Options are set in a yaml configuration file. There is an example you can use as a starting point.

Parameters:
  • path – absolute path to the file on the system or relative to the FS object supplied in the filesystem parameter
  • filesystem (keyword) – a pyfilesystem2 FS object where the yaml config file is located.
backup()[source]

Using the configuration from the file, create the backup.

restore(infilename, new_file)[source]

Restore backup to a plain text csv file for uploading to password manager.

Parameters:
  • infilename – the name of the backup file
  • new_file – the filename to save the data to

File I/O

read_backup(backing_store_fs, infile, prefix='')[source]

Read a backup file from some pyfilesystem.

Parameters:
  • backing_store_fs – The pyfilesystem object where the file is located
  • infile – the name of the file
  • prefix (optional) – the prefix before the filename
Returns:

raw file data

write_out_backup(backing_store_fs, data, outfile, prefix='')[source]

Write the backup data to its final location. A backing store is required and either a filepath to the packaged backup or the tmp filesystem is required.

Parameters:
  • backing_store_fs – a pyfilesystem2 object to be the final storage location of the backup. (should be OSFS, S3FS, FTPFS, etc.) Can be a single object or list of filesystem objects for copying to multiple backing stores.
  • data – the byte stream that needs to be written to the file on the backing store fs.
  • outfile – the name of the file to write out to.
  • prefix (optional) – a parent directory for the files to be saved under. This is can be a good place to encode some information about the backup. A slash will be appended to the prefix to create a directory or pseudo-directory structure.