esrf_pathlib.core#

Classes

ESRFPath(*args, **kwargs)

Provides all features of pathlib.Path with additional attributes depending on the matching ESRF filesystem path template.

class esrf_pathlib.core.ESRFPath(*args, **kwargs)[source]#

Bases: _BaseESRFPath

Provides all features of pathlib.Path with additional attributes depending on the matching ESRF filesystem path template.

classmethod from_fields(schema_name=None, schema_version=None, template_name=None, **fields)[source]#

Create ESRFPath from schema fields.

Raises:
Parameters:
  • schema_name (Optional[str])

  • schema_version (Optional[int])

  • template_name (Optional[str])

  • fields (Union[str, date, DataType, TomoResultType, None])

Return type:

ESRFPath

classmethod from_path(path, schema_name=None, schema_version=None, template_name=None)[source]#

Instantiate ESRFPath with a specific schema, schema version and template.

Raises:
Parameters:
  • path (Union[str, Path])

  • schema_name (Optional[str])

  • schema_version (Optional[int])

  • template_name (Optional[str])

Return type:

ESRFPath

replace_fields(template_name=None, **fields)[source]#

Creates a new ESRFPath, replacing fields with values from fields.

Raises:
Parameters:
Return type:

ESRFPath

strip_mount_point()[source]#

Remove leading segments typically introduced by ESRFPath.resolve().

Return type:

ESRFPath

property schema_name: str#

Name of the ESRF path schema if it matches a registered schema.

property template_name: str#

Name of the ESRF path template if it matches a template from a registered schema.