Skip to main content

Python bindings for KFReader, a library from the ADF computational chemistry package

Project description

kfreader-cffi is a Python package for reading binary result files produced by the Amsterdam Density Functional (ADF) program suite ( Instead of, this package does not require working ADF installation.

It uses CFFI to interface with the original C library KFReader.


Note that kfreader-cffi currently is only tested under Python 3.x on Ubuntu

First we need to install some prerequisites:

apt-get update
apt-get install build-essential gcc libffi-dev python3-dev

Then to install the package, simply:

pip install kfreader-cffi

Or for development:

git clone
pip install -e kfreader-cffi

Shared library will be automatically built from C source files provided in /vendor directory during the installation process (see Makefile for details).

Now you are ready to go!

Getting started

Before attempting to use this package, you might find the official documentation on TAPE21 useful.


>>> from kfreader import KFReader, kfropen

# Open a TAPE21 file.
>>> kfr = KFReader('file.t21')
# Get the value of a variable given its section and name.
>>> kfr.get_data('General', 'file-ident')
>>> kfr.close()

# We can also seamlessly use the with-statement.
# Let's simplify the above example:
>>> with kfropen('file.t21') as kfr:
>>>     # Use the reader as regular. The file will be closed
>>>     # when the block ends.
>>>     print(kfr.get_data('General', 'termination status'))


Many thanks to Alexei Yakovlev and all the other developers ( of the original C routines. This package would not exist without their work.

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
kfreader-cffi-0.2.4.tar.gz (22.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page