Accessing H-M and Hall structure information by MP-ID

Disclamer: I am new to coding so there is probably a more efficient way to do this
I am attempting to obtain crystallographic data based on an inputted materials project ID. I have been able to obtain the international table number but not the Hall or H-M space group number is there a method to easily access this information?

with MPRester(api_key="apikey") as mpr:
        #Pulls the Materials Project data for the specified ID
        selected_material =[key_number])
        chem_data =[key_number])

        symmetry_IT_number = chem_data[0].symmetry.number #This is the international table number
        #Can the space groups be obtained in both H-M and Hall notation in a similar manner to this? 

#key number is just a number I select to pull from the material_ids list of MP-IDs

Hi @Thomas_Alling:

If mpid_list below is a list of MPID strings, e.g., ["mp-13","mp-149"]:

from mp_api.client import MPRester
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer

with MPRester() as mpr:
   docs =

for doc in docs:
   sga = SpacegroupAnalyzer(doc.structure)
   symm_info = sga.get_symmetry_dataset()
   print(doc.material_id, {k: v for k, v in symm_info.items() if k in {"hall", "hall_number", "international", "number"}})

The hall key corresponds to the Hall notation symbol, and hall_number to its index. international corresponds to the Hermann-Mauguin symbol, and number to the international space group table number.

You can also call doc.structure.get_space_group_info() on a structure to get its HM symbol and intl space group number.