Skip to main content

fchic is a minimal parser for Gaussian 16 formatted checkpoint files.

Project description

fchic

fchic is a tiny library for parsing Gaussian formatted checkpoint files into python data structures. To use it, simply point it at a file and give it a deck to load, like so:

import fchic

with open("data.fchk", "r") as f:
    out = fchic.deck_load(f, "Cartesian Gradient")

out is now a list of 3 x N floating point numbers parsed from the Cartesian Gradient section of data.fchk.

Note: fchic does no data validation (beyond shape and type), no physical unit conversions and no integration into fancy data structures. It is entirely a single page, simple pyparsing grammar. You'll need to do your own data processing from its outputs.

Usage

fchic consists of two functions:

  • fchic.load(fp) transform a formatted checkpoint file in from a file-like object fp into a python dictionary of decks.
  • fchic.deck_load(fp, name) loads the specific deck name from file-like object fp.

Versions of those functions that acts on strings (fchic.loads() and fchic.deck_loads) are also provided.

Decks are returned thinly parsed from the formatted checkpoint files:

  • Integer values (type I) are parsed into lists of python int.
  • Real values (type R) are parsed into lists of python float.
  • Char values (type C) are parsed into a unary list containing a string.

Python is not exactly fast, and neither is pyparsing, so you'll generally want to use fchic.deck_load() which does not have to parse the whole file, and is therefore way way 🐇 faster 🐇.

Installation

pip install fchic

License

fchic is provided under the MIT license.

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

fchic-0.1.1.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

fchic-0.1.1-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

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