Skip to main content

A package for parsing Quantum Chemistry program file outputs into structured qcio data objects.

Project description

qcparse

A library for parsing Quantum Chemistry output files into structured data objects. Uses data structures from qcio.

image image image Actions status Actions status Ruff

☝️ NOTE

This package was originally designed to run as a standalone parser to generate SinglePointOutput and ProgramFailure objects parsing all input and provenance data in addition to computed output data; however, once qcop was built to power quantum chemistry programs the only parsing needed was for the simpler SinglePointResults values. There are still remnants of the original parse function in the repo and I've left them for now in case I find a use for the general purpose parsing.

✨ Basic Usage

  • Installation:

    python -m pip install qcparse
    
  • Parse a file into a SinglePointResults object with a single line of code.

    from qcparse import parse_results
    
    results = parse_results("/path/to/tc.out", "terachem")
    
  • The results object will be a SinglePointResults object. Run dir(results) inside a Python interpreter to see the various values you can access. A few prominent values are shown here as an example:

    from qcparse import parse_results
    
    results = parse_results("/path/to/tc.out", "terachem")
    
    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.json())
    
  • And read from disk like this:

    from qcio import SinglePointResults
    
    results = SinglePointResults.open("results.json")
    
  • You can also run qcparse from the command line like this:

    qcparse -h # Get help message for cli
    
    qcparse terachem ./path/to/tc.out > results.json # Parse TeraChem stdout to json
    

💻 Contributing

If there's data you'd like parsed fromI output files, 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.

If you'd like to add a parser yourself see the docstring in qcparse.parsers for a primer and see the examples written in the module. Adding a parser for new data is quick and easy :)

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

qcparse-0.5.1.tar.gz (11.1 kB view hashes)

Uploaded Source

Built Distribution

qcparse-0.5.1-py3-none-any.whl (13.0 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