qccodec


Nameqccodec JSON
Version 0.9.0 PyPI version JSON
download
home_pageNone
SummaryA package for parsing Quantum Chemistry program file outputs into structured qcio data objects.
upload_time2025-10-09 18:43:48
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseThe MIT License (MIT) Copyright (c) 2023 Colton Hicks Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords computational chemistry file parser parsing qcio quantum chemistry scientific computing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://github.com/coltonbh/qcio).

[![image](https://img.shields.io/pypi/v/qccodec.svg)](https://pypi.python.org/pypi/qccodec)
[![image](https://img.shields.io/pypi/l/qccodec.svg)](https://pypi.python.org/pypi/qccodec)
[![image](https://img.shields.io/pypi/pyversions/qccodec.svg)](https://pypi.python.org/pypi/qccodec)
[![Actions status](https://github.com/coltonbh/qccodec/workflows/Tests/badge.svg)](https://github.com/coltonbh/qccodec/actions)
[![Actions status](https://github.com/coltonbh/qccodec/workflows/Basic%20Code%20Quality/badge.svg)](https://github.com/coltonbh/qccodec/actions)

`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](https://github.com/coltonbh/qcconst) - Physical constants, conversion factors, and a periodic table with clear source information for every value.
- [qcio](https://github.com/coltonbh/qcio) - Beautiful and user friendly data structures for quantum chemistry.
- [qccodec](https://github.com/coltonbh/qccodec) - A library for efficient parsing of quantum chemistry data into structured `qcio` objects and conversion of `qcio` input objects to program-native input files.
- [qcop](https://github.com/coltonbh/qcop) - A package for operating quantum chemistry programs using `qcio` standardized data structures. Compatible with `TeraChem`, `psi4`, `QChem`, `NWChem`, `ORCA`, `Molpro`, `geomeTRIC` and many more.
- [BigChem](https://github.com/mtzgroup/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](https://github.com/mtzgroup/chemcloud-server) and associated [Python client](https://github.com/mtzgroup/chemcloud-client) for exposing a BigChem cluster securely over the internet.

## ✨ Basic Usage

- Installation:

  ```sh
  python -m pip install qccodec
  ```

- Parse QC program outputs into structured data files with a single line of code.

  ```python
  from pathlib import Path
  from qcio import CalcType
  from qccodec import decode

  stdout = Path("tc.out").read_text()
  data = decode("terachem", CalcType.gradient, stdout=stdout)
  ```

- The `data` object will be a `qcio` object, either `SinglePointData`, `OptimizationData`, `ConformerSearchData` or other `*Data` structure depending on the `calctype`. Run `dir(data)` inside a Python interpreter to see the various values you can access. A few prominent values are shown here as an example:

  ```python
  from pathlib import Path
  from qcio import CalcType
  from qccodec import decode

  stdout = Path("tc.out").read_text()
  data = decode("terachem", CalcType.hessian, stdout=stdout)

  data.energy
  data.gradient # If a gradient calc
  data.hessian # If a hessian calc
  data.calcinfo_nmo # Number of molecular orbitals
  ```

- Parsed values can be written to disk like this:

  ```py
  with open("data.json", "w") as f:
      f.write(data.model_dumps_json())
  ```

- And read from disk like this:

  ```py
  from qcio import SinglePointData

  data = SinglePointData.open("data.json")
  ```

- You can also run `qccodec` from the command line like this:

  ```sh
  qccodec -h # Get help message for cli

  qccodec terachem hessian tests/data/terachem/water.frequencies.out > data.json # Parse TeraChem stdout to json
  ```

- More complex parsing can be accomplished by passing the directory containing the scratch files to `decode` and optionally the input data used to generate the calculation (usually done from `qcop` which uses structure data):

  ```python
  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")

  data = decode("terachem", CalcType.hessian, stdout=stdout, directory=directory, input_data=input_data)
  ```

## 💻 Contributing

Please see the [contributing guide](./CONTRIBUTING.md) 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](https://github.com/coltonbh/qccodec/issues/2).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "qccodec",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "computational chemistry, file parser, parsing, qcio, quantum chemistry, scientific computing",
    "author": null,
    "author_email": "Colton Hicks <github@coltonhicks.com>",
    "download_url": "https://files.pythonhosted.org/packages/2f/17/0083b860463e1ca22b2772634f91c28f45b717f53d1d1f58e86e06b6243b/qccodec-0.9.0.tar.gz",
    "platform": null,
    "description": "# qccodec\n\nA 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](https://github.com/coltonbh/qcio).\n\n[![image](https://img.shields.io/pypi/v/qccodec.svg)](https://pypi.python.org/pypi/qccodec)\n[![image](https://img.shields.io/pypi/l/qccodec.svg)](https://pypi.python.org/pypi/qccodec)\n[![image](https://img.shields.io/pypi/pyversions/qccodec.svg)](https://pypi.python.org/pypi/qccodec)\n[![Actions status](https://github.com/coltonbh/qccodec/workflows/Tests/badge.svg)](https://github.com/coltonbh/qccodec/actions)\n[![Actions status](https://github.com/coltonbh/qccodec/workflows/Basic%20Code%20Quality/badge.svg)](https://github.com/coltonbh/qccodec/actions)\n\n`qccodec` works in harmony with a suite of other quantum chemistry tools for fast, structured, and interoperable quantum chemistry.\n\n## The QC Suite of Programs\n\n- [qcconst](https://github.com/coltonbh/qcconst) - Physical constants, conversion factors, and a periodic table with clear source information for every value.\n- [qcio](https://github.com/coltonbh/qcio) - Beautiful and user friendly data structures for quantum chemistry.\n- [qccodec](https://github.com/coltonbh/qccodec) - A library for efficient parsing of quantum chemistry data into structured `qcio` objects and conversion of `qcio` input objects to program-native input files.\n- [qcop](https://github.com/coltonbh/qcop) - A package for operating quantum chemistry programs using `qcio` standardized data structures. Compatible with `TeraChem`, `psi4`, `QChem`, `NWChem`, `ORCA`, `Molpro`, `geomeTRIC` and many more.\n- [BigChem](https://github.com/mtzgroup/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.\n- `ChemCloud` - A [web application](https://github.com/mtzgroup/chemcloud-server) and associated [Python client](https://github.com/mtzgroup/chemcloud-client) for exposing a BigChem cluster securely over the internet.\n\n## \u2728 Basic Usage\n\n- Installation:\n\n  ```sh\n  python -m pip install qccodec\n  ```\n\n- Parse QC program outputs into structured data files with a single line of code.\n\n  ```python\n  from pathlib import Path\n  from qcio import CalcType\n  from qccodec import decode\n\n  stdout = Path(\"tc.out\").read_text()\n  data = decode(\"terachem\", CalcType.gradient, stdout=stdout)\n  ```\n\n- The `data` object will be a `qcio` object, either `SinglePointData`, `OptimizationData`, `ConformerSearchData` or other `*Data` structure depending on the `calctype`. Run `dir(data)` inside a Python interpreter to see the various values you can access. A few prominent values are shown here as an example:\n\n  ```python\n  from pathlib import Path\n  from qcio import CalcType\n  from qccodec import decode\n\n  stdout = Path(\"tc.out\").read_text()\n  data = decode(\"terachem\", CalcType.hessian, stdout=stdout)\n\n  data.energy\n  data.gradient # If a gradient calc\n  data.hessian # If a hessian calc\n  data.calcinfo_nmo # Number of molecular orbitals\n  ```\n\n- Parsed values can be written to disk like this:\n\n  ```py\n  with open(\"data.json\", \"w\") as f:\n      f.write(data.model_dumps_json())\n  ```\n\n- And read from disk like this:\n\n  ```py\n  from qcio import SinglePointData\n\n  data = SinglePointData.open(\"data.json\")\n  ```\n\n- You can also run `qccodec` from the command line like this:\n\n  ```sh\n  qccodec -h # Get help message for cli\n\n  qccodec terachem hessian tests/data/terachem/water.frequencies.out > data.json # Parse TeraChem stdout to json\n  ```\n\n- More complex parsing can be accomplished by passing the directory containing the scratch files to `decode` and optionally the input data used to generate the calculation (usually done from `qcop` which uses structure data):\n\n  ```python\n  from pathlib import Path\n  from qcio import CalcType, ProgramInput\n  from qccodec import decode\n\n  stdout = Path(\"tc.out\").read_text()\n  directory = Path(\".\") / \"scr.geom\"\n  input_data = ProgramInput.open(\"prog_inp.json\")\n\n  data = decode(\"terachem\", CalcType.hessian, stdout=stdout, directory=directory, input_data=input_data)\n  ```\n\n## \ud83d\udcbb Contributing\n\nPlease see the [contributing guide](./CONTRIBUTING.md) for details on how to contribute new parsers to this project :)\n\nIf 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](https://github.com/coltonbh/qccodec/issues/2).\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)\n        \n        Copyright (c) 2023 Colton Hicks\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in\n        all copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n        THE SOFTWARE.",
    "summary": "A package for parsing Quantum Chemistry program file outputs into structured qcio data objects.",
    "version": "0.9.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/coltonbh/qccodec/issues",
        "Changelog": "https://github.com/coltonbh/qccodec/blob/master/CHANGELOG.md",
        "Documentation": "https://github.com/coltonbh/qccodec#readme",
        "Homepage": "https://github.com/coltonbh/qccodec",
        "Source": "https://github.com/coltonbh/qccodec"
    },
    "split_keywords": [
        "computational chemistry",
        " file parser",
        " parsing",
        " qcio",
        " quantum chemistry",
        " scientific computing"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c8f3c927721458c8cd84e3cf0554cf55497c0f879f608ca17944a1c8d5189725",
                "md5": "c44066cfb5c16db8520eeb2079373d3f",
                "sha256": "953d27230e3d954daaa8aa1c0869f228ea4741cee3b624c780684b0d681a080f"
            },
            "downloads": -1,
            "filename": "qccodec-0.9.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c44066cfb5c16db8520eeb2079373d3f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 24626,
            "upload_time": "2025-10-09T18:43:46",
            "upload_time_iso_8601": "2025-10-09T18:43:46.613670Z",
            "url": "https://files.pythonhosted.org/packages/c8/f3/c927721458c8cd84e3cf0554cf55497c0f879f608ca17944a1c8d5189725/qccodec-0.9.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2f170083b860463e1ca22b2772634f91c28f45b717f53d1d1f58e86e06b6243b",
                "md5": "0edd08d55f46085e3d476876960a8e69",
                "sha256": "f1fe3630093a47ae24047db670e5da5fd470fbef09e29f0aff93fb7135437e6e"
            },
            "downloads": -1,
            "filename": "qccodec-0.9.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0edd08d55f46085e3d476876960a8e69",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 401329,
            "upload_time": "2025-10-09T18:43:48",
            "upload_time_iso_8601": "2025-10-09T18:43:48.314563Z",
            "url": "https://files.pythonhosted.org/packages/2f/17/0083b860463e1ca22b2772634f91c28f45b717f53d1d1f58e86e06b6243b/qccodec-0.9.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-09 18:43:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "coltonbh",
    "github_project": "qccodec",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "qccodec"
}
        
Elapsed time: 2.16301s