tempo_eval.read_annotations
- tempo_eval.read_annotations(path, derive_version=None, namespace='tempo', derive_item_id=<function <lambda>>, validate=True, split_by_corpus=False)[source]
Recursively read all jam files from the given directory.
- Parameters
path (
str) – base directoryderive_version (
Optional[Callable[[str,Annotation],str]]) – function that derives a version a given annotationnamespace (
Union[str,Iterable[str]]) – one or more jam annotation namespace(s), e.g.,tempofor tempo annotationsderive_item_id (
Callable[[str,JAMS],str]) – function that returns an id given a file name and jamsvalidate (
bool) – validate jam while reading (validation impacts performance negatively)split_by_corpus (
bool) – wrap results in a dict with corpus names (extracted from jams) as keys
- Return type
Union[Dict[str,Dict[str,Dict[str,Annotation]]],Dict[str,Dict[str,Dict[str,Dict[str,Annotation]]]]]- Returns
jam annotation objects, organized as nested dicts with version and item ids as keys, if
split_by_corpusthe outermost dict uses corpus names as keys- Raises
FileNotFoundError – if
pathdoes not exist or is not a directory