Battery explorer using pymatgen

I am trying to get all the battery electrode materials insertion or conversion using pymatgen rather than getting the data from the website directly. I am using jupyter notebook and needs a code that extracts these data and prints or plots their volume change/capacity/density/voltage etc.

Hi @MSA the following code snippet should work.

from pymatgen import MPRester

def get_battery_data(self, formula_or_batt_id):
    """Returns batteries from a batt id or formula.

    return self._make_request('/battery/%s' % formula_or_batt_id)

MPRester.get_battery_data = get_battery_data


Hello @jshen, I have tried to use the code snippet to get the battery data however there is no such function avaiable in the MPRester class.
I am using the latest pymatgen version( 2020.12.31).Is there anything that I am missing here?

Hi @Haider_BASF function is must be added to MPRester using

MPRester.get_battery_data = get_battery_data

Thank you @jshen for your quick response.