gastropy.parse_bids_filename

gastropy.parse_bids_filename#

gastropy.parse_bids_filename(path)[source]#

Parse BIDS key-value entities from a filename.

Parameters:

path (str or Path) – A BIDS-style filename, e.g. sub-01_ses-0001_task-rest_physio.tsv.gz.

Returns:

Dictionary of BIDS entities. Always includes "suffix" (the final label before the extension) and "extension".

Example:

{"sub": "01", "ses": "0001", "task": "rest",
 "suffix": "physio", "extension": ".tsv.gz"}

Return type:

dict