validate_identifier

emmet.core.mpid_ext.validate_identifier(idx, serialize=False)

Format an input string or identifier as a valid Materials Project format identifier.

Return type:

str | MPID | AlphaID | SuffixedID

Parameters:

Parameters

idxstr or MPID or AlphaID or SuffixedID

The input identifier, can either be an already instantiated identifier object, or a plain string

serializebool = False

If True, returns the string representation of the identifier object. If False, returns the object.