Extract ionization_energy and electron_affinity properties of pure element by pymatgen

Hello, everyone:
I have successfully extracted electronegativity via following code,

import pymatgen as pmg
ele = pmg.Element(‘Mg’)
ele.X

but I didn’t found how to extract ionization_energy and electron_affinity properties, anyone can help me, thanks!

Hello @Slame

You can find details on all pymatgen functions and classes here: pymatgen.core.periodic_table module — pymatgen 2022.0.4 documentation
Seems like what you’re looking for is ionization_energies and unfortunately, electron affinities don’t seem to be part of the Element class.
Also, in the future, your questions seem to be focused on Pymatgen, not the Materials Project. Pymatgen has a separate section on this website.

-Peter