Skip to main content
https://travis-ci.org/mstolyarchuk/kfreader-cffi.svg?branch=master

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

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

Installation

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 https://github.com/mstolyarchuk/kfreader-cffi
pip install -e kfreader-cffi

Shared library libkfreader.so 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.

Usage

>>> 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')
'TAPE21'
>>> 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'))
'NORMAL TERMINATION'

Acknowledgments

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

Metadata

Release files for kfreader-cffi 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kfreader-cffi 0.2.4
File Size Uploaded Provenance Actions
kfreader-cffi-0.2.4.tar.gz 22.2 kB Without provenance Details for kfreader-cffi-0.2.4.tar.gz

Release files / kfreader-cffi-0.2.4.tar.gz

Download URL kfreader-cffi-0.2.4.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8f33165ab1269fa78fd2dc976b3238199396b6db3f490089280fdcc7a47d7f53
BLAKE2b-256 checksum
How to use checksums
d0fe243eae18a5e6b6bd400bd4349a774dd930b2dc3b96aeb4dfee1ff0619adf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for kfreader-cffi 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page