Getting Band structure data as a File

I am using this script to get the band structure data, but i am unable to view what type of file this is (txt or anything else) and unable to view the coordinates or download the file like this
bands.pp.gnu.txt (123.5 KB). Can anyone Help me with this? Or do I need to use snippets from this to generate the code.

Thank you for your time!

Regards
Bhavuk

@munrojm Can you please help?

Hi @bhavuk,

What you get from the API is a pymatgen BandStructure object. Here is the documentation for that data structure: pymatgen.electronic_structure.bandstructure module — pymatgen 2022.11.7 documentation.

If you want the raw band data which can be saved in another file like the one you show, you can access the bands attribute of the object. Alternatively, you can also have BSPlotter format it for you, alongside some additional derived data. You can use the BSPlotter.bs_plot_data method for that (pymatgen/plotter.py at 3b5b90e4f13a4418f3b93a4a97c55b8640e7cf84 · materialsproject/pymatgen · GitHub)

– Jason

Thanks munrojm.