Menu

pycaravel: This module is designed to simplify continuous integration (CI) of data from multiple projects.

Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the gallery for the big picture.

class caravel.parsers.parser_base.ParserBase(project, confdir, layoutdir)[source]

Base parser to retrieve data from a BIDS directory.

Initialize the Caravel class.

Parameters:

project : str

the name of the project you are working on.

confdir : str

the locations of the configuration file of the current project.

layoutdir : str

the location of the pre-generated parsing representations. If None switch to managers mode.

can_load()[source]

A method checking the dataset type.

Returns:

out : bool

True if the dataset can be loaded, False otherwise.

export_layout(name)[source]

Export a layout as a pandas DataFrame.

Parameters:

name : str

the name of the layout.

Returns:

df : pandas DataFrame

the converted layout.

filter_layout(name, extensions=None, **kwargs)[source]

Filter the layout by using a combination of key-values rules.

Parameters:

name : str

the name of the layout.

extensions : str or list of str

a filtering rule on the file extension.

kwargs : dict

the filtering options.

Returns:

df : pandas DataFrame

the filtered layout.

list_keys(name)[source]

List all the filtering keys available in the layout.

Parameters:

name : str

the name of the layout.

Returns:

keys : list

the layout keys.

list_values(name, key)[source]

List all the filtering key values available in the layout.

Parameters:

name : str

the name of the layout.

key : str

the name of key in the layout.

Returns:

values : list

the key associated values in the layout.

load_data(name, df, replace=None)[source]

Load the data contained in the filename column of a pandas DataFrame.

Note: Only a couple of file extensions are supported. If no loader has been found None is returned.

Parameters:

name : str

the name of the layout.

df : pandas DataFrame

a table with one ‘filename’ column.

replace : 2-uplet, default None

in the case of a CubicWeb resource, the data are downloaded in a custom folder. Use this parameter to replace the server location by your own location.

Returns:

data : dict

a dictionaray containing the loaded data.

Follow us

© 2025, Antoine Grigis