A Python suite for manipulating VASP input and output

bjmorgan, updated πŸ•₯ 2022-09-10 17:39:36

vasppy - a Python suite for manipulating VASP files

DOI PyPI version Build Status Test Coverage Documentation Status

vasppy is a suite of Python tools and scripts written in Python for manipulating and processing VASP input and output files.


Automated testing of the latest build happens here

Manual tests can be run using python3 -m unittest discover

API documentation

API documentation is hosted at Read the Docs.


potcar_spec should return a pair of lists, not a dictionary

opened on 2020-12-30 14:54:48 by bjmorgan

The potcar_spec() function in summary.py currently returns a dictionary of {name, md5_hash}. This does not work as expected when the same species appears more than once in the POTCAR file. A better implementation would be to return a pair of lists of [names], [md5_hashes].

Doscar class doesn’t handle simple DOSCAR outputs well

opened on 2020-07-07 08:40:26 by bjmorgan

The DOSCAR class currently raises an error for DOSCAR files that do not include pDOS data.

e.g. https://github.com/bjmorgan/vasppy/issues/13

It would be helpful if the parser checks whether there is pDOS data present and can report appropriately. And / or allows simple DOS datasets to be loaded.

procar.py suggestion

opened on 2019-12-31 12:20:07 by mwistey

Thanks for the python interface!

In procar.py, I would suggest replacing this: regex = re.compile( 'k-point\s+(\d+)\s:\s+([- ][01].\d{8})([- ][01].\d{8})([- ][01].\d{8})\s+weight = ([01].\d+)' )
...with this... regex = re.compile( 'k-point\s+(\d+)\s
:\s+([- ][01].\d+)([- ][01].\d+)([- ][01].\d+)\s+weight = (-[01].\d+)' )

I've run into one modified version of VASP that has an extra space after the "weight =". This way it's a little less fragile. - Mark

Can you provide some examples or scripts on how to use vasppy?

opened on 2019-09-04 03:09:48 by obaica

Thank you for your hard work to develop such good software. Can you provide some examples or scripts on how to use vasppy? Because I am not very familiar with the python language.


Version 2021-01-24 15:08:07

Adds simple Vasprun class for parsing vasprun.xml data.

2020-06-15 17:17:24

Minor update to potcar_spec to include option to print md5 hashes of POTCARs

2020-02-22 13:07:26

Updates to vasp_summary parsing of summary vasp data. - Defaults to parse_dos=False when parsing vasprun.xml to speed up processing. - Added a -b command line option to show a progress bar. - Added a -j n command line option for parallel parsing of VASP calculation directories.

2020-02-13 11:23:27

Bug fixes and updates, including: - POTCAR hashes now include "revised" VASP POTCAR *_54 formats. - Tests relying on physical constants use the updated scipy 1.4.1 values.

Procar refactoring 2019-05-17 08:50:23

Extensive refactoring to the Procar class, that introduces breaking changes:

  • The preferred ways to read PROCAR files are now Procar.from_file() and Procar.from_files(). Procar.read_from_file() is deprecated as a public method and will be removed in a future version.
  • Procar.from_files() takes a list of file path strings, and collates each PROCAR in sequence. This is useful where e.g. a band structure calculation has been split over multiple VASP calculations.
  • Procar.from_file() now has an optional select_zero_weighted_kpoints argument. Setting this to True will return a Procar object that only has those k-points with zero weights. This is useful for processing data from hybrid DFT calculations, where some k-points might have zero weightings.
  • Procar.from_files() inherits all keyword arguments from Procar.from_file().
  • Procar objects can be concatenated, using normal addition operators.
  • Specific k-points can be selected, as a new Procar object, using the select_k_points() method.

2019-05-05 09:36:53

Benjamin Morgan

Computational Chemistry at the University of Bath, UK.

GitHub Repository