Difficulty in retrieving pymatgen bandstructure data using the new mp_api materials summary search method

Hello community members,

I’ve been trying to retrieve crystal structure data from the MP database for featurization using Matminer. I used the summary.search() method of the new mp_api but I couldn’t find an efficient way to get the bandstructure data in <pymatgen.electronic_structure.bandstructure.BandStructure> format. Matminer featurizers take pymatgen bandstructure data as the function argument. As of now, most end points of the mp_api that I’ve tried return the bandstructure in <emmet.core.electronic_structure.BandstructureData> format.

Although there are end points like materials.electronic_structure_bandstructure() that return the data in the required format (<pymatgen.electronic_structure.bandstructure.BandStructure> format) using this method to retrieve the bandstructure alone is time consuming.

Please let me know if there’s any way to convert the <emmet.core.electronic_structure.BandstructureData> data into corresponding <pymatgen.electronic_structure.bandstructure.BandStructure> data. Or if there’s any way for me to retrieve pymatgen bandstructure data in bulk using the search() or similar methods.

Please refer to the images that I’ve attached for reference. Thank you in advance.

Below is the emmet data object that search method from mp_api returns.

The required data type from the band structure endpoint of the mp_api

Hi @Mah_shook,

Your two options are to write code to pull one-by-one with the client as you have in your second code snippet, or pull in bulk directly from our AWS OpenData S3 bucket. You can see here for more information on how to do that: AWS OpenData | Materials Project Documentation

– Jason

1 Like

Thank you Jason.