Skip to content

The issues on retrieval of crystal properties based on Crystal System #4156

Answered by DanielYang59
brl1999 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @brl1999. If I understand correctly, you want to get materials via MP_API of specific crystal system (cubic in your case)? Checkout the official docs.

If that is the case you might want to try the following:

To get all matches:

from mp_api.client import MPRester
import pandas as pd


# Query MP data (e.g., for cubic crystal systems)
# Reference: https://api.materialsproject.org/docs#/
with MPRester() as mpr:
    cubic_materials = mpr.materials.summary.search(
        crystal_system="Cubic"
    )

    # Convert the query results to a list of dictionaries
    data = [material.model_dump() for material in cubic_materials]

# Convert to DataFrame
df_cubic = pd.DataFrame(data).set_index("ma…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@brl1999
Comment options

@DanielYang59
Comment options

@brl1999
Comment options

@DanielYang59
Comment options

Answer selected by brl1999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants