Skip to content

Commit

Permalink
wip: coarse idea
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Oct 24, 2024
1 parent 1686c3d commit 07e620e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/py/mat3ra/standata/__init__.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 07e620e

Please sign in to comment.