I am working on some Graph Neural Network Based model on materials structure and for that I need to download all 49,705 materials. For that i need a list of all mp-ids.How to get that so that using that through py-matgen i can download the CIF files of those 49,705 materails.Please help me.
Please use the pymatgen interface, with that you can just query for all the structures and then output them to cif. Something like this:
from pymatgen import MPRester
with MPRester("INSERT_API_KEY_HERE") as mpr:
docs = mpr.query({},["structure","task_id"])
for d in docs:
d["structure"].to(filename=f"{task_id}.cif",fmt="CIF")
This will also ensure to get data from our server efficiently.