storage
Package¶
storage_interface
¶
This module is an interface for the tvb storage module. All calls to methods from this module must be done through this class.
- class tvb.storage.storage_interface.StorageInterface[source]¶
Bases:
object
- EXPORTED_SIMULATION_DTS_DIR = 'datatypes'¶
- EXPORTED_SIMULATION_NAME = 'exported_simulation'¶
- EXPORT_FOLDER = '/home/tvb_user/TVB_STORAGE/EXPORT_TMP'¶
- EXPORT_FOLDER_NAME = 'EXPORT_TMP'¶
- FILE_NAME_STRUCTURE = '{}_{}.h5'¶
- IMAGES_FOLDER = 'IMAGES'¶
- OPERATION_FOLDER_PREFIX = 'Operation_'¶
- PROJECTS_FOLDER = 'PROJECTS'¶
- ROOT_NODE_PATH = '/'¶
- TEMP_FOLDER = 'TEMP'¶
- TVB_PROJECT_FILE = 'Project.xml'¶
- TVB_STORAGE_FILE_EXTENSION = '.h5'¶
- TVB_XML_FILE_EXTENSION = '.xml'¶
- TVB_ZIP_FILE_EXTENSION = '.zip'¶
- export_datatypes(dt_path_list, data, download_file_name, public_key_path=None, password=None)[source]¶
This method is used to export a list of datatypes as a ZIP file. :param dt_path_list: a list of paths to be exported (there are more than one when exporting with links) :param data: data to be exported :param download_file_name: name of the zip file to be downloaded :param public_key_path: path to public key that will be used for encrypting the password by TVB :param password: password used for encrypting the files before exporting
- export_datatypes_structure(op_file_dict, data, download_file_name, public_key_path, password, links_tuple_for_copy=None)[source]¶
This method is used to export a list of datatypes as a ZIP file, while preserving the folder structure (eg: operation folders). It is only used during normal tvb exporting for datatype groups. :param op_file_dict: a dictionary where keys are operation folders and the values are lists of files inside
that operation folder
- Parameters:
data – data to be exported
download_file_name – name of the ZIP file to be exported
public_key_path – path to public key that will be used for encrypting the password by TVB
password – password used for encrypting the files before exporting
links_tuple_for_copy – a tuple containing two elements: a list of paths to be copied and the first datatype of the group
- export_project(project, folders_to_exclude, linked_paths, op)[source]¶
This method is used to export a project as a ZIP file. :param project: project to be exported. :param folders_to_exclude: a list of paths to folders inside of a project folder which should not be exported. :param linked_paths: a list of links to datatypes for the project to be exported :param op: operation for links to exported datatypes (if any)
- export_simulator_configuration(burst, all_view_model_paths, all_datatype_paths, zip_filename)[source]¶
This method is used to export a simulator configuration as a ZIP file :param burst: BurstConfiguration of the simulation to be exported :param all_view_model_paths: a list of paths to all view model files of the simulation :param all_datatype_paths: a list of paths to all datatype files of the simulation :param zip_filename: name of the file to be exported
- logger = <Logger tvb.storage.storage_interface (INFO)>¶
Subpackages¶
h5
Packagedecorators
utils
- Subpackages
encryption
Packagedata_encryption_handler
DataEncryptionHandler
DataEncryptionHandler.APP_ENCRYPTION_HANDLER
DataEncryptionHandler.CRYPTO_PASS
DataEncryptionHandler.ENCRYPTED_FOLDER_SUFFIX
DataEncryptionHandler.KEYS_FOLDER
DataEncryptionHandler.app_encryption_handler()
DataEncryptionHandler.check_and_delete()
DataEncryptionHandler.compute_encrypted_folder_path()
DataEncryptionHandler.dec_queue_count()
DataEncryptionHandler.dec_running_op_count()
DataEncryptionHandler.encryption_enabled()
DataEncryptionHandler.file_helper
DataEncryptionHandler.inc_project_usage_count()
DataEncryptionHandler.inc_running_op_count()
DataEncryptionHandler.is_in_usage()
DataEncryptionHandler.linked_projects
DataEncryptionHandler.lock
DataEncryptionHandler.marked_for_delete
DataEncryptionHandler.project_key_path()
DataEncryptionHandler.push_folder_to_sync()
DataEncryptionHandler.queue_elements_count
DataEncryptionHandler.running_operations
DataEncryptionHandler.set_project_active()
DataEncryptionHandler.set_project_inactive()
DataEncryptionHandler.startup_cleanup()
DataEncryptionHandler.sync_folders()
DataEncryptionHandler.sync_project_queue
DataEncryptionHandler.users_project_usage
DataEncryptionHandlerBuilder
DataEncryptionHandlerMeta
DataEncryptionRemoteHandler
DataEncryptionRemoteHandler.check_and_delete()
DataEncryptionRemoteHandler.dec_queue_count()
DataEncryptionRemoteHandler.dec_running_op_count()
DataEncryptionRemoteHandler.inc_project_usage_count()
DataEncryptionRemoteHandler.inc_running_op_count()
DataEncryptionRemoteHandler.is_in_usage()
DataEncryptionRemoteHandler.lock
DataEncryptionRemoteHandler.push_folder_to_sync()
DataEncryptionRemoteHandler.set_project_active()
DataEncryptionRemoteHandler.set_project_inactive()
DataEncryptionRemoteHandler.startup_cleanup()
DataEncryptionRemoteHandler.sync_folders()
FoldersQueueConsumer
InvalidStorageEncryptionException
encryption_handler
EncryptionHandler
EncryptionHandler.cleanup_encryption_handler()
EncryptionHandler.decrypt_files_to_dir()
EncryptionHandler.decrypt_results_to_dir()
EncryptionHandler.encrypt_inputs()
EncryptionHandler.encrypted_dir_name_regex
EncryptionHandler.encrypted_suffix
EncryptionHandler.generate_random_password()
EncryptionHandler.get_encrypted_dir()
EncryptionHandler.get_password_file()
import_export_encryption_handler
ImportExportEncryptionHandler
ImportExportEncryptionHandler.DECRYPTED_DATA_SUFFIX
ImportExportEncryptionHandler.ENCRYPTED_DATA_SUFFIX
ImportExportEncryptionHandler.ENCRYPTED_PASSWORD_NAME
ImportExportEncryptionHandler.PRIVATE_KEY_NAME
ImportExportEncryptionHandler.PUBLIC_KEY_NAME
ImportExportEncryptionHandler.add_encrypted_suffix()
ImportExportEncryptionHandler.decrypt_content()
ImportExportEncryptionHandler.encrypt_and_save_password()
ImportExportEncryptionHandler.encrypt_data_at_export()
ImportExportEncryptionHandler.encrypt_password()
ImportExportEncryptionHandler.extract_encrypted_password_from_list()
ImportExportEncryptionHandler.generate_public_private_key_pair()
ImportExportEncryptionHandler.get_path_to_encrypt()
ImportExportEncryptionHandler.load_public_key()
ImportExportEncryptionHandler.save_encrypted_password()
file
Packageexceptions
files_helper
FilesHelper
FilesHelper.ALLEN_MOUSE_CONNECTIVITY_CACHE_FOLDER
FilesHelper.PROJECTS_FOLDER
FilesHelper.check_created()
FilesHelper.compute_recursive_h5_disk_usage()
FilesHelper.compute_size_on_disk()
FilesHelper.copy_file()
FilesHelper.get_allen_mouse_cache_folder()
FilesHelper.get_images_folder()
FilesHelper.get_project_folder()
FilesHelper.get_project_folder_from_h5()
FilesHelper.get_project_meta_file_path()
FilesHelper.get_projects_folder()
FilesHelper.move_datatype()
FilesHelper.read_project_metadata()
FilesHelper.remove_figure()
FilesHelper.remove_files()
FilesHelper.remove_folder()
FilesHelper.remove_operation_data()
FilesHelper.rename_project_structure()
FilesHelper.write_image_metadata()
FilesHelper.write_project_metadata()
FilesHelper.write_project_metadata_from_dict()
TvbZip
hdf5_storage_manager
HDF5StorageManager
HDF5StorageManager.BOOL_VALUE_PREFIX
HDF5StorageManager.DATETIME_VALUE_PREFIX
HDF5StorageManager.DATE_TIME_FORMAT
HDF5StorageManager.H5pyStorageBuffer
HDF5StorageManager.LOCKS
HDF5StorageManager.ROOT_NODE_PATH
HDF5StorageManager.TVB_ATTRIBUTE_PREFIX
HDF5StorageManager.append_data()
HDF5StorageManager.close_file()
HDF5StorageManager.get_data()
HDF5StorageManager.get_data_shape()
HDF5StorageManager.get_file_data_version()
HDF5StorageManager.get_metadata()
HDF5StorageManager.is_valid_tvb_file()
HDF5StorageManager.remove_data()
HDF5StorageManager.remove_metadata()
HDF5StorageManager.serialize_bool()
HDF5StorageManager.set_metadata()
HDF5StorageManager.store_data()
xml_metadata_handlers
kube
Package