Skip to content
Python toolkit for working with PIFs
Branch: develop
Clone or download
Latest commit 938348a Nov 1, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Automatically regenerating apidoc Jan 31, 2017
.travis.yml Fixing the password Feb 7, 2017
LICENSE apache 2 Mar 23, 2016 Adding links and badges to readme Jan 31, 2017
requirements.txt Pin requirements to specific versions for reproducibility. Nov 1, 2018
setup.cfg Move numpy requirement from requirements.txt to Oct 31, 2018


status PyPI version


Tools to serialize and deserialize to and from the PIF schema. This package provides python objects for each object in the PIF schema and methods for serialization and deserialization.

There is a companion Java library called JPIF.



  • Python >= 2.7 or >= 3.3


pypif is published on PyPI, so it can be installed with pip:

$ pip install pypif


The following example creates a PIF record that saves the band gap of MgO2 as equal to 7.8 eV.

from pypif import pif
from pypif.obj import *

chemical_system = ChemicalSystem()
chemical_system.chemical_formula = 'MgO2'

band_gap = Property() = 'Band gap'
band_gap.scalars = 7.8
band_gap.units = 'eV' = band_gap

print(pif.dumps(chemical_system, indent=4))

This example will serialize to the following JSON representation:

    "category": "system.chemical",
    "chemicalFormula": "MgO2",
    "properties": {
        "units": "eV",
        "name": "Band gap",
        "scalars": [
                "value": 7.8


A detailed discussion of the PIF schema and usage are available at

You can’t perform that action at this time.