esrf_pathlib._schemas.fields.concept#
Classes
|
Concept that is part of an ESRF path. |
- class esrf_pathlib._schemas.fields.concept.PathConcept(name, description, schema_identifier, regex, deserializer=<class 'str'>, serializer=<class 'str'>, score=1, default_value=None, examples=None)[source]#
Bases:
FieldConcept that is part of an ESRF path. For example beamline, proposal, collection, etc.
- Parameters:
name (
str)description (
str)schema_identifier (
SchemaIdentifier)regex (
str)deserializer (
Union[Callable[[str],Union[str,date,DataType,TomoResultType,None]],Type[Any]])serializer (
Union[Callable[[Union[str,date,DataType,TomoResultType,None]],str],Type[Any]])score (
int)default_value (
Any)examples (
Optional[List[str]])
- deserialize(string_value)[source]#
String value used in the path to Python object.
- Raises:
- Parameters:
string_value (
Optional[str])- Return type:
Union[str,date,DataType,TomoResultType,None]
- serialize(py_value, raise_on_missing=True)[source]#
Python object to string value used in the path. When missing and
raise_on_missing=Falsethe value"*"is returned.- Raises:
- Parameters:
py_value (
Union[str,date,DataType,TomoResultType,None])raise_on_missing (
bool)
- Return type:
str
- property regex: str#
- property score: int#