{"id":20749720,"url":"https://github.com/tilde-lab/quantum_esperanto","last_synced_at":"2025-09-09T22:05:07.099Z","repository":{"id":57459297,"uuid":"99029873","full_name":"tilde-lab/quantum_esperanto","owner":"tilde-lab","description":"Very fast parser for the XML logs produced with the VASP, Vienna Ab initio Simulation Package","archived":false,"fork":false,"pushed_at":"2024-02-28T15:16:51.000Z","size":740,"stargazers_count":6,"open_issues_count":8,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-18T03:27:03.730Z","etag":null,"topics":["ab-initio","dft","material-design","materials","materials-informatics","materials-science","vasp","xml-files"],"latest_commit_sha":null,"homepage":"","language":"Cython","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tilde-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-01T18:09:12.000Z","updated_at":"2024-02-28T15:31:36.000Z","dependencies_parsed_at":"2024-02-28T16:45:07.649Z","dependency_job_id":null,"html_url":"https://github.com/tilde-lab/quantum_esperanto","commit_stats":{"total_commits":42,"total_committers":4,"mean_commits":10.5,"dds":0.2142857142857143,"last_synced_commit":"c2bc18dad282a66e6af305bee8670b69d437688d"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilde-lab%2Fquantum_esperanto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilde-lab%2Fquantum_esperanto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilde-lab%2Fquantum_esperanto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilde-lab%2Fquantum_esperanto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tilde-lab","download_url":"https://codeload.github.com/tilde-lab/quantum_esperanto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243048214,"owners_count":20227593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ab-initio","dft","material-design","materials","materials-informatics","materials-science","vasp","xml-files"],"created_at":"2024-11-17T08:24:16.884Z","updated_at":"2025-03-11T14:18:22.595Z","avatar_url":"https://github.com/tilde-lab.png","language":"Cython","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quantum Esperanto\n\n[![DOI](https://zenodo.org/badge/99029873.svg)](https://doi.org/10.5281/zenodo.7693601)\n[![PyPI](https://img.shields.io/pypi/v/quantum_esperanto.svg?style=flat)](https://pypi.org/project/quantum_esperanto)\n[![Build Status](https://travis-ci.org/tilde-lab/quantum_esperanto.svg?branch=master)](https://travis-ci.org/tilde-lab/quantum_esperanto)\n\n*Quantum Esperanto* is a fast parser of XML files output by DFT codes (such as VASP) written in Cython.\nIt takes advantage of lxml, a Python wrapper around `libxml2` library, and its Cython interface.\nXML files are parsed to a Python dictionary in a transparent way. It is really fast, up to 10 times faster than the\nparser used by pymatgen project.\n\n## Installation\n\nThe development versions of libraries `libxml2` and `libxslt` must be present in the system. Check with the command:\n\n```\n  $ xslt-config\n```\n\nAlso, a C-compiler such as `gcc` must be present. The recommended way of installing Quantum Esperanto is with `pip` from PyPI:\n\n```\n  $ pip install quantum_esperanto\n```\n\nIf one is interested in obtaining latest versions of the package, it can be installed using the source code from GitHub:\n\n```\n  $ git clone https://github.com/tilde-lab/quantum_esperanto\n  $ cd quantum_esperanto\n  $ pip install .\n```\n\nThe Python prerequisites for the package are `numpy` and `lxml` (should be installed automatically with `pip`).\nIt is possible to install the package in development mode. This will install `Cython` as well as `nose` test suite.\nTo do it issue the following command after cloning the repository and changing the directory:\n\n```\n  $ cd quantum_esperanto\n  $ pip install -e .[dev]\n```\n\nAfter installation run several tests to check if the procedure was completed successfully. It can be\ndone with the following commands in `quantum_esperanto` directory:\n\n```\n  $ python setup.py test\n```\n\nIf everything is OK, you're all set to start using the package.\n\n## Usage\n\nThe parser can be used in a very simple way. First, the parser has to be instantiated, and then the `parse_file`\nmethod of the parser returns the dictionary of parsed values:\n\n```\n  from quantum_esperanto.vasp import VaspParser\n  parser = VaspParser()\n  d = parser.parse_file('vasprun.xml')\n```\n\nThe possible arguments for the parser are:\n\n**recover**\n  (boolean, default: *True*) a flag that allows recovering broken XML. It is very useful in case of unfinished\n  calculations; however, it exits on the first XML error and the returned dictionary contains parsed values up to the\n  first XML error only. When XML recovery is needed, a warning is printed to stderr.\n\n**whitelist**\n  (list, default: *None*) the list of parent tag names that are only needed to parsed. If None, then all tags are parsed.\n\n### Parsing result\n\nThe result of parsing is a dictionary that follows the structure of `vasprun.xml`. The keys of the dictionary are\neither tag names (for `i`, `v`, `varray` tags), or `tag:tag name` construction (for tags that do have name\nattribute), or just tags themselves. The values are either tag contents converted to the right type (specified by `type`\ntag attribute) or (in case of varrays and sets) Numpy arrays. Fortran overflows (denoted by `*****`) are converted to\nNaNs in case of float values and to MAXINT in case of integer values.\n\n### Example\n\n```xml\n \u003cstructure name=\"primitive_cell\" \u003e\n  \u003ccrystal\u003e\n   \u003cvarray name=\"basis\" \u003e\n    \u003cv\u003e       1.43300000       1.43300000       1.43300000 \u003c/v\u003e\n    \u003cv\u003e       1.43300000      -1.43300000      -1.43300000 \u003c/v\u003e\n    \u003cv\u003e      -1.43300000       1.43300000      -1.43300000 \u003c/v\u003e\n   \u003c/varray\u003e\n   \u003ci name=\"volume\"\u003e     11.77059895 \u003c/i\u003e\n   \u003cvarray name=\"rec_basis\" \u003e\n    \u003cv\u003e       0.34891835       0.34891835       0.00000000 \u003c/v\u003e\n    \u003cv\u003e       0.34891835      -0.00000000      -0.34891835 \u003c/v\u003e\n    \u003cv\u003e      -0.00000000       0.34891835      -0.34891835 \u003c/v\u003e\n   \u003c/varray\u003e\n  \u003c/crystal\u003e\n  \u003cvarray name=\"positions\" \u003e\n   \u003cv\u003e       0.00000000       0.00000000       0.00000000 \u003c/v\u003e\n  \u003c/varray\u003e\n \u003c/structure\u003e\n```\n\nThe *resulting dictionary* reads (printed with *pprint*):\n\n```\n  {'structure:primitive_cell': {'crystal': {'basis': array([[ 1.433,  1.433,  1.433],\n                                                            [ 1.433, -1.433, -1.433],\n                                                            [-1.433,  1.433, -1.433]]),\n                                            'rec_basis': array([[ 0.34891835,  0.34891835,  0.        ],\n                                                                [ 0.34891835, -0.        , -0.34891835],\n                                                                [-0.        ,  0.34891835, -0.34891835]]),\n                                            'volume': 11.77059895},\n                                'positions': array([[ 0.,  0.,  0.]])}}\n```\n\n## License\n\nMIT \u0026copy; Andrey Sobolev, Tilde Materials Informatics\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftilde-lab%2Fquantum_esperanto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftilde-lab%2Fquantum_esperanto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftilde-lab%2Fquantum_esperanto/lists"}