How to extract space group and crystal system info based on id

I am trying to use the new API to extract information relating to the space groups. I was able to do this with the legacy API. Wondering if anyone can provide some info on this Help appreciated

Here’s an example:

from mp_api.client import MPRester

with MPRester() as mpr:
    docs = mpr.summary.search(
        fields=["material_id", "symmetry"], material_ids=["mp-1", "mp-1234"]
    )

for doc in docs:
    print(f"{doc.material_id}: {doc.symmetry}")

Prints:

mp-1234: crystal_system=<CrystalSystem.cubic: ‘Cubic’> symbol=‘Fd-3m’ number=227 point_group=‘m-3m’ symprec=0.1 version=‘1.16.2’
mp-1: crystal_system=<CrystalSystem.cubic: ‘Cubic’> symbol=‘Im-3m’ number=229 point_group=‘m-3m’ symprec=0.1 version=‘1.16.2’

1 Like