Difference between revisions of "Developer's Area"

From Wiki
Jump to: navigation, search
(Accessing Materials Project data from any program)
Line 6: Line 6:
  
 
Although you can use any programming language to develop applications, we recommend the Python programming language. Python is the language of the Materials Project codebases, is widely used and supported by the scientific community, and allows for rapid development. If you choose not to use Python, we suggest a language with good JSON parsing support (JSON is the data exchange format of the Materials Project). In addition, we suggest a language that can easily make requests to web servers and fetch responses as JSON.
 
Although you can use any programming language to develop applications, we recommend the Python programming language. Python is the language of the Materials Project codebases, is widely used and supported by the scientific community, and allows for rapid development. If you choose not to use Python, we suggest a language with good JSON parsing support (JSON is the data exchange format of the Materials Project). In addition, we suggest a language that can easily make requests to web servers and fetch responses as JSON.
 +
 +
== Programming environment ==
 +
 +
If you are programming in Python, we suggest using a Python IDE such as Pycharm or Eclipse+PyDev. However, some people prefer to use a UNIX-style text editor such as vi or emacs.
 +
 +
== Getting and analyzing data using Pymatgen ==
 +
 +
The Materials Project provides an open-source Python code, pymatgen (Python Materials Genomics), that can be used to:
 +
 +
* access Materials Project data
 +
* convert data between several file formats
 +
* perform materials analyses
 +
* set up calculations
 +
 +
The pymatgen code provides many examples on how to perform common tasks. For example, this [https://gist.github.com/shyuep/3570304 gist] by Shyue Ping Ong demonstrates how to generate phase diagrams dynamically using Materials Project data, as well as check if a new computed material is stable with respect to decomposition into the set of all compounds computed by the Materials Project.
 +
 +
To get started, we suggest you visit the [http://pythonhosted.org/pymatgen/ official pymatgen documentation]
  
 
== Accessing Materials Project data from any program ==
 
== Accessing Materials Project data from any program ==
  
 +
The pymatgen code is one avenue
 
With the Materials API, you can get Materials Project data from any program that can perform a GET request to our server. To get started:
 
With the Materials API, you can get Materials Project data from any program that can perform a GET request to our server. To get started:
  
Line 21: Line 39:
  
 
A simple description of the Materials API is given at http://www.materialsproject.org/open# (click the 'Materials API' button). For more details, see our documentation on [[The Materials API]].
 
A simple description of the Materials API is given at http://www.materialsproject.org/open# (click the 'Materials API' button). For more details, see our documentation on [[The Materials API]].
 +
 +
== Automating code using FireWorks ==
 +
 +
FireWorks is a code for automating calculations over supercomputing clusters. It is currently in pre-alpha and is being tested internally by the Materials Project team. We will update this page when FireWorks is ready for use by general developers.

Revision as of 22:31, 25 February 2013

Welcome

Welcome to the Materials Project Developer's Area. This page describes how to develop your own applications using the data and software of the Materials Project.

Programming language

Although you can use any programming language to develop applications, we recommend the Python programming language. Python is the language of the Materials Project codebases, is widely used and supported by the scientific community, and allows for rapid development. If you choose not to use Python, we suggest a language with good JSON parsing support (JSON is the data exchange format of the Materials Project). In addition, we suggest a language that can easily make requests to web servers and fetch responses as JSON.

Programming environment

If you are programming in Python, we suggest using a Python IDE such as Pycharm or Eclipse+PyDev. However, some people prefer to use a UNIX-style text editor such as vi or emacs.

Getting and analyzing data using Pymatgen

The Materials Project provides an open-source Python code, pymatgen (Python Materials Genomics), that can be used to:

  • access Materials Project data
  • convert data between several file formats
  • perform materials analyses
  • set up calculations

The pymatgen code provides many examples on how to perform common tasks. For example, this gist by Shyue Ping Ong demonstrates how to generate phase diagrams dynamically using Materials Project data, as well as check if a new computed material is stable with respect to decomposition into the set of all compounds computed by the Materials Project.

To get started, we suggest you visit the official pymatgen documentation

Accessing Materials Project data from any program

The pymatgen code is one avenue With the Materials API, you can get Materials Project data from any program that can perform a GET request to our server. To get started:

  1. Generate an API key in your profile page.
    • Log into the Materials Project web site (top-right)
    • Click 'profile' (top-right)
    • In the section labeled 'API key', click 'regenerate key'. This is your API key (copy it).
    • Click 'Save Settings' (your API key will not work until this is done)
  2. Make a GET request to a valid URL, for example: https://www.materialsproject.org/rest/v1/materials/C/vasp/density?API_KEY=YOUR_API_KEY
    • (make sure you replace the text YOUR_API_KEY with your Materials Project API key)
    • You should see a JSON-formatted response that includes the density of the material.

A simple description of the Materials API is given at http://www.materialsproject.org/open# (click the 'Materials API' button). For more details, see our documentation on The Materials API.

Automating code using FireWorks

FireWorks is a code for automating calculations over supercomputing clusters. It is currently in pre-alpha and is being tested internally by the Materials Project team. We will update this page when FireWorks is ready for use by general developers.