A package for parsing Quantum Chemistry program file outputs into structured qcio data objects.
Project description
qccodec
A library for parsing Quantum Chemistry output files into structured data objects and converting structured input objects into program-native input files. Uses data structures from qcio.
qccodec works in harmony with a suite of other quantum chemistry tools for fast, structured, and interoperable quantum chemistry.
The QC Suite of Programs
- qcconst - Physical constants, conversion factors, and a periodic table with clear source information for every value.
- qcio - Beautiful and user friendly data structures for quantum chemistry.
- qccodec - A library for efficient parsing of quantum chemistry data into structured
qcioobjects and conversion ofqcioinput objects to program-native input files. - qcop - A package for operating quantum chemistry programs using
qciostandardized data structures. Compatible withTeraChem,psi4,QChem,NWChem,ORCA,Molpro,geomeTRICand many more. - BigChem - A distributed application for running quantum chemistry calculations at scale across clusters of computers or the cloud. Bring multi-node scaling to your favorite quantum chemistry program.
ChemCloud- A web application and associated Python client for exposing a BigChem cluster securely over the internet.
✨ Basic Usage
-
Installation:
python -m pip install qccodec
-
Parse QC program outputs into structured data files with a single line of code.
from pathlib import Path from qcio import CalcType from qccodec import decode stdout = Path("tc.out").read_text() results = decode("terachem", CalcType.gradient, stdout=stdout)
-
The
resultsobject will be aqcioobject, eitherSinglePointResults,OptimizationResults, orConformerSearchResultsdepending on thecalctype. Rundir(results)inside a Python interpreter to see the various values you can access. A few prominent values are shown here as an example:from pathlib import Path from qcio import CalcType from qccodec import decode stdout = Path("tc.out").read_text() results = decode("terachem", CalcType.hessian, stdout=stdout) results.energy results.gradient # If a gradient calc results.hessian # If a hessian calc results.calcinfo_nmo # Number of molecular orbitals
-
Parsed values can be written to disk like this:
with open("results.json", "w") as f: f.write(result.model_dumps_json())
-
And read from disk like this:
from qcio import SinglePointResults results = SinglePointResults.open("results.json")
-
You can also run
qccodecfrom the command line like this:qccodec -h # Get help message for cli qccodec terachem hessian tests/data/terachem/water.frequencies.out > results.json # Parse TeraChem stdout to json
-
More complex parsing can be accomplished by passing the directory containing the scratch files to
decodeand optionally the input data used to generate the calculation (usually done fromqcopwhich uses structure data):from pathlib import Path from qcio import CalcType, ProgramInput from qccodec import decode stdout = Path("tc.out").read_text() directory = Path(".") / "scr.geom" input_data = ProgramInput.open("prog_inp.json") results = decode("terachem", CalcType.hessian, stdout=stdout, directory=directory, input_data=input_data)
💻 Contributing
Please see the contributing guide for details on how to contribute new parsers to this project :)
If there's data you'd like parsed from output files or want to support input files for a new program, please open an issue in this repo explaining the data items you'd like parsed and include an example output file containing the data, like this.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qccodec-0.7.7.tar.gz.
File metadata
- Download URL: qccodec-0.7.7.tar.gz
- Upload date:
- Size: 384.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68f5efccad97223db6be23d1a65685f4a3a37a7c5ddb92dd6165a4dc8a23f4fa
|
|
| MD5 |
f4952b92269f29fcb548d511c5d1b368
|
|
| BLAKE2b-256 |
ae61854b68375d427a0aa155fbf66223df2edcba7e9f1847d4f9e76ce68fb9b5
|
Provenance
The following attestation bundles were made for qccodec-0.7.7.tar.gz:
Publisher:
publish-to-pypi.yaml on coltonbh/qccodec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qccodec-0.7.7.tar.gz -
Subject digest:
68f5efccad97223db6be23d1a65685f4a3a37a7c5ddb92dd6165a4dc8a23f4fa - Sigstore transparency entry: 248172055
- Sigstore integration time:
-
Permalink:
coltonbh/qccodec@4aa22dab52cc0aeac5bb2bf5161aa92d891d090f -
Branch / Tag:
refs/tags/0.7.7 - Owner: https://github.com/coltonbh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yaml@4aa22dab52cc0aeac5bb2bf5161aa92d891d090f -
Trigger Event:
push
-
Statement type:
File details
Details for the file qccodec-0.7.7-py3-none-any.whl.
File metadata
- Download URL: qccodec-0.7.7-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76203d440faf9d9282b6cde9976669c87df30ed9f63642376db1e3502e2ae788
|
|
| MD5 |
ee4c34dfe7a2053a1425f0a1145c2ed0
|
|
| BLAKE2b-256 |
da33e2bb78310abf5876a5d25c115280bb59fc872628b1b1cc8a66dd1f56d1ff
|
Provenance
The following attestation bundles were made for qccodec-0.7.7-py3-none-any.whl:
Publisher:
publish-to-pypi.yaml on coltonbh/qccodec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qccodec-0.7.7-py3-none-any.whl -
Subject digest:
76203d440faf9d9282b6cde9976669c87df30ed9f63642376db1e3502e2ae788 - Sigstore transparency entry: 248172079
- Sigstore integration time:
-
Permalink:
coltonbh/qccodec@4aa22dab52cc0aeac5bb2bf5161aa92d891d090f -
Branch / Tag:
refs/tags/0.7.7 - Owner: https://github.com/coltonbh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yaml@4aa22dab52cc0aeac5bb2bf5161aa92d891d090f -
Trigger Event:
push
-
Statement type: