BidsTabularFile

class BidsTabularFile(file_path)[source]

A BIDS tabular file including its associated sidecar.

Methods

hed.tools.bids.bids_tabular_file.BidsTabularFile.__init__(...)

Constructor for a BIDS tabular file.

hed.tools.bids.bids_tabular_file.BidsTabularFile.clear_contents()

Set the contents attribute of this object to None.

hed.tools.bids.bids_tabular_file.BidsTabularFile.get_entity(...)

hed.tools.bids.bids_tabular_file.BidsTabularFile.get_key([...])

Return a key for this BIDS file given a list of entities.

hed.tools.bids.bids_tabular_file.BidsTabularFile.set_contents([...])

Set the contents of this tabular file.

Attributes

hed.tools.bids.bids_tabular_file.BidsTabularFile.contents

Return the current contents of this object.

BidsTabularFile.__init__(file_path)[source]

Constructor for a BIDS tabular file.

Parameters:

file_path (str) – Path of the tabular file.

BidsTabularFile.clear_contents()

Set the contents attribute of this object to None.

BidsTabularFile.get_entity(entity_name)
BidsTabularFile.get_key(entities=None)

Return a key for this BIDS file given a list of entities.

Parameters:

entities (tuple) – A tuple of strings representing entities.

Returns:

A key based on this object.

Return type:

str

Notes

If entities is None, then the file path is used as the key

BidsTabularFile.set_contents(content_info=None, overwrite=False)[source]

Set the contents of this tabular file.

Parameters:
  • content_info (None) – This always uses the internal file_path to create the contents.

  • overwrite – If False, do not overwrite existing contents if any.

BidsTabularFile.contents

Return the current contents of this object.