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 objectfp
into a python dictionary of decks.fchic.deck_load(fp, name)
loads the specific deckname
from file-like objectfp
.
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 pythonint
. - Real values (type
R
) are parsed into lists of pythonfloat
. - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fchic-0.1.1.tar.gz
.
File metadata
- Download URL: fchic-0.1.1.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 987146a63d86ea6e9d4000e1288671f2ef7f14887c8224b1818e27f85cca822a |
|
MD5 | d28578b5010a8cb2359dda637114b262 |
|
BLAKE2b-256 | 93bdd4895541a2100b288382e5f1b0263fbbe25fbf00217dbdda76008111de38 |
File details
Details for the file fchic-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: fchic-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | abc49bf9864b8798200a471e11485eac1c6af73d66a5ac60559dc6ef03e2d827 |
|
MD5 | d4a1974be98992f4ce54166c7055085f |
|
BLAKE2b-256 | 22c92df9da7911b0ad28c28793de79943aa90200d9c37b271af2c260b3f4d6b8 |