The Virtual Brain Project

Table Of Contents

Previous topic

h5 Package

Next topic

simulator Package

This Page

exporters Package

Define a list with all Python modules in which the introspect mechanism should search for Export Adapters.


Root class for export functionality.

class tvb.adapters.exporters.abcexporter.ABCExporter[source]

Bases: builtins.object

Base class for all data type exporters This should provide common functionality for all TVB exporters.


This method specify if the current exporter can export provided data. :param data: data to be checked :returns: true if this data can be exported by current exporter, false otherwise.

export(data, export_folder, project)[source]

Actual export method, to be implemented in each sub-class.

  • data – data type to be exported
  • export_folder – folder where to write results of the export if needed. This is necessary in case new files are generated.
  • project – project that contains data to be exported

a tuple with the following elements:

  1. name of the file to be shown to user
  2. full path of the export file (available for download)
  3. boolean which specify if file can be deleted after download


This method computes the extension of the export file :param data: data type to be exported :returns: the extension of the file to be exported (e.g zip or h5)


This method computes the name used to save exported data on user computer


This method returns a string to be used on the UI controls to initiate export

Returns:string to be used on UI for starting this export. By default class name is returned

This method specify what types are accepted by this exporter. Method should be implemented by each subclass and return an array with the supported types.

Returns:an array with the supported data types.

Checks if the provided data, ready for export is a DataTypeGroup or not


Exceptions for Export mechanism.

exception tvb.adapters.exporters.exceptions.ExportException(message)[source]

Bases: tvb.basic.exceptions.TVBException

Generic export exception.

exception tvb.adapters.exporters.exceptions.InvalidExportDataException(message)[source]

Bases: tvb.basic.exceptions.TVBException

Exception thrown when an invalid data is provided for export


Class responsible for all TVB exports (datatype or project).

class tvb.adapters.exporters.export_manager.ExportManager[source]

Bases: builtins.object

This class provides basic methods for exporting data types of projects in different formats.

all_exporters = {}
Parameters:burst_id – ID for existing burst
Returns:JSON of burst representation.
export_data(data, exporter_id, project)[source]

Export provided data using given exporter :param data: data type to be exported :param exporter_id: identifier of the exporter to be used :param project: project that contains data to be exported

Returns:a tuple with the following elements 1. name of the file to be shown to user 2. full path of the export file (available for download) 3. boolean which specify if file can be deleted after download
export_folder = None
export_project(project, optimize_size=False)[source]

Given a project root and the TVB storage_path, create a ZIP ready for export. :param project: project object which identifies project to be exported


Get available exporters for current data type. :returns: a dictionary with the {exporter_id : label}


class tvb.adapters.exporters.tvb_export.TVBExporter[source]

Bases: tvb.adapters.exporters.abcexporter.ABCExporter

This exporter simply provides for download data in TVB format

export(data, export_folder, project)[source]

Exports data type: 1. If data is a normal data type, simply exports storage file (HDF format) 2. If data is a DataTypeGroup creates a zip with all files for all data types