Details and Options
ResourceFunction["MaterialsProjectData"] is a wrapper to a part of the Python Materials Genomics (
Pymatgen) package.
If the necessary Python dependencies are not installed, the first invocation of
ResourceFunction["MaterialsProjectData"] can take longer than usual as the function attempts to install the necessary packages automatically, using the resource function
PythonEvaluateWithDependencies.
Should the automatic installation fail, it might still be possible to install the necessary packages manually using the resource function
PythonPackageInstall.
In ResourceFunction["MaterialsProjectData"][crit,…], crit can be one of the following:
"string" | string |
Molecule[…] | molecule object |
Entity["Chemical",…] | chemical entity object |
expr | expression to be exported to a string in the "JSON" format |
{expr,format} | expression in the specified format |
In the string form, crit can be a chemical formula, possibly with a wild card "*", a Materials ID, chemical system, string representing a Mongo-style dictionary and other strings accepted by the Pymatgen package.
expr is typically an association or a set of rules representing a Mongo-style dictionary.
prop must be a string representing one of the acceptable properties,
Automatic to give a list of most common properties, or
All to give a list of values of all available properties.
ResourceFunction["MaterialsProjectData"][crit] is equivalent to
ResourceFunction["MaterialsProjectData"][crit,Automatic].
ResourceFunction["MaterialsProjectData"]["Properties"] gives the list of acceptable property names.
ResourceFunction["MaterialsProjectData"] returns a list of associations with keys corresponding to the specified properties.
The following options are accepted:
"Endpoint" | Automatic | URL of the REST interface |
"ChunkSize" | 500 | chunk size of the results from the database |
"MaxTriesPerChunk" | 5 | number of times to retry fetching a given chunk |
"MaterialsProjectDecode" | True | whether to try decoding Pymatgen objects |
The option
"Endpoint"→Automatic refers to the standard URL of the Materials Project REST interface.
ResourceFunction["MaterialsProjectData"][…,session] avoids the overhead of opening a new Python session for every successive call.