diff --git a/src/py/mat3ra/standata/__init__.py b/src/py/mat3ra/standata/__init__.py index 7f11e04..869d872 100644 --- a/src/py/mat3ra/standata/__init__.py +++ b/src/py/mat3ra/standata/__init__.py @@ -1 +1,22 @@ +from typing import List + from .base import Standata +from .materials import materials_data + + +class StandataMaterials: + + def __init__(self): + self.entities = materials_data + + def get_by_name(self, name: str) -> List[dict]: + """Returns entity by name. + + Args: + name: Name of the entity. + """ + matching_entities = [] + for key, entity in self.entities["filesMapByName"].items(): + if name in key: + matching_entities.append(entity) + return matching_entities