esrf_pathlib._schemas.fields.tree#
Functions
|
Convert a nested dictionary with |
|
Convert several segment lists to a stringified representation of a directory structure. |
Classes
|
|
|
- class esrf_pathlib._schemas.fields.tree.PathTemplateArguments(name, segments)[source]#
Bases:
NamedTuple- Parameters:
name (
str)segments (
List[SegmentTemplate])
- name: str#
Alias for field number 0
- segments: List[SegmentTemplate]#
Alias for field number 1
- class esrf_pathlib._schemas.fields.tree.SegmentTemplate(template, mandatory, symbolic_root_segment)[source]#
Bases:
NamedTuple- Parameters:
template (
str)mandatory (
bool)symbolic_root_segment (
Optional[str])
- mandatory: bool#
Alias for field number 1
- symbolic_root_segment: str | None#
Alias for field number 2
- template: str#
Alias for field number 0
- esrf_pathlib._schemas.fields.tree.parse_template_tree(template_tree, symbolic_root_segment=None, _parent_segments=None)[source]#
Convert a nested dictionary with
RawSegmentTypekeys to a flat list ofPathTemplatearguments.- Parameters:
template_tree (
Dict[Union[str,Tuple[str],Tuple[str,str],Tuple[str,str,bool]],Optional[dict]])symbolic_root_segment (
Optional[str])_parent_segments (
Optional[List[PathTemplateArguments]])
- Return type:
List[PathTemplateArguments]
- esrf_pathlib._schemas.fields.tree.tree_as_strings(segments)[source]#
Convert several segment lists to a stringified representation of a directory structure.
For example
{data_root}/{proposal}/{beamline}/{session_date}/ ├── {proposal}_{beamline}.h5 └── {collection}/ ├── {proposal}_{collection}.h5 └── {dataset}/ └── {collection}_{dataset}.h5- Parameters:
segments (
List[List[SegmentTemplate]])- Return type:
List[str]