Skip to main content

Exabyte Property Ex(ss)tractor, Sourcer, Serializer class.

Project description

PyPI version License: Apache


Exabyte Property Extractor, Sourcer, Serializer (ExPreSS) is a Python package to extract material- and simulation-related properties and serialize them according to the Exabyte Data Convention (EDC) outlined in Exabyte Source of Schemas and Examples (ESSE).


As below:

  • Extract structural information, material properties and from simulation data
  • Serialize extracted information according to ESSE/EDC
  • Support for multiple simulation engines, including:

The package is written in a modular way easy to extend for additional applications and properties of interest. Contributions can be in the form of additional functionality and bug/issue reports.


The following diagram presents the package architecture. The package provides an interface to extract properties in EDC format. Inside the interface Property classes are initialized with a Parser (Vasp, Espresso, or Structure) depending on the given parameters through the parser factory. Each Property class implements required calls to Parser functions listed in these Mixins Classes to extract raw data either from the textual files, XML files or input files in string format and implements a serializer to form the final property according to the EDC format.



As explained above, ExPreSS parsers are responsible for extracting raw data from different sources such as data on the disk and provide the raw data to properties classes. In order to make sure all parsers implement the same interfaces and abstract properties classes from the parsers implementations, a set a Mixin Classes are provided which should be mixed with the parsers. The parsers must implement Mixins' abstract methods at the time of inheritance.


ExPreSS properties classes are responsible to form the properties based on the raw data provided by the parsers and serialize the property according to EDC. A list of supported properties are available in here.


Extractors are classes that are composed with the parsers to extract raw data from the corresponding sources such as text or XML.


ExPreSS can be installed as a Python package either via PyPi or the repository as below.


pip install express


  1. Install git-lfs in order to pull the files stored on Git LFS.

  2. Clone repository:

    git clone
  3. Install virtualenv using pip if not already present:

    pip install virtualenv
  4. Create virtual environment and install required packages:

    cd exabyte-express
    virtualenv venv
    source venv/bin/activate
    export GIT_LFS_SKIP_SMUDGE=1


Extract Total Energy

The following example demonstrates how to initialize an ExPreSS class instance, to extract and serialize total energy produced in a Quantum ESPRESSO calculation. The full path to the calculation directory (work_dir) and the file containing standard output (stdout_file) are required to be passed as arguments to the underlying Espresso parser.

import json
from express import ExPrESS

kwargs = {
    "work_dir": "./tests/fixtures/espresso/test-001",
    "stdout_file": "./tests/fixtures/espresso/test-001/pw-scf.out"


express_ = ExPrESS("espresso", **kwargs)
print json.dumps("total_energy"), indent=4)

Extract Relaxed Structure

In this example the final structure of a VASP calculation is extracted and is serialized to a material. The final structure is extracted from the CONTCAR file located in the calculation directory (work_dir). is_final_structure=True argument should be passed to the Material Property class to let it know to extract final structure.

import json
from express import ExPrESS

kwargs = {
    "work_dir": "./tests/fixtures/vasp/test-001",
    "stdout_file": "./tests/fixtures/vasp/test-001/vasp.out"


express_ = ExPrESS("vasp", **kwargs)
print json.dumps("material", is_final_structure=True), indent=4)

Extract Structure from Input

One can use StructureParser to extract materials from POSCAR or PW input files. Please note that StructureParser class only works with strings and not files and therefore the input files should be read first and then passed to the parser.

import json
from express import ExPrESS

with open("./tests/fixtures/vasp/test-001/POSCAR") as f:
    poscar =

kwargs = {
    "structure_string": poscar,
    "structure_format": "poscar"

express_ = ExPrESS("structure", **kwargs)
print json.dumps("material"), indent=4)

with open("./tests/fixtures/espresso/test-001/") as f:
    pwscf_input =

kwargs = {
    "structure_string": pwscf_input,
    "structure_format": "espresso-in"

express_ = ExPrESS("structure", **kwargs)
print json.dumps("material"), indent=4)


There are two types of tests in ExPreSS, unit and integration, implemented in Python Unit Testing Framework.

Unit Tests

Unit tests are used to assert properties are serialized according to EDC. Properties classes are initialized with mocked parser data and then are serialized to assert functionality.

Integration Tests

Parsers functionality is tested through integration tests. The parsers are initialized with the configuration specified in the Tests Manifest and then the functionality is asserted.

Run Tests

Note that the CI tests are run using a github action in .github, and not using the script below, so there could be discrepancies.

Run the following commands to run the tests.

sh -t=unit
sh -t=integration


This repository is an open-source work-in-progress and we welcome contributions. We suggest forking this repository and introducing the adjustments there, the changes in the fork can further be considered for merging into this repository as explained in GitHub Standard Fork and Pull Request Workflow.

TODO list

Desirable features for implementation:

  • Add support for other properties
  • Add support for other types of applications, parsers and extractors
  • other (TBA)


  1. Exabyte Source of Schemas and Examples (ESSE), Github Repository
  2. Vienna Ab-initio Simulation Package (VASP), official website
  3. Quantum ESPRESSO, Official Website

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

express-py-2023.9.12.post1.tar.gz (7.7 MB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page