Skip to main content

Thermochemical properties calculator — computes Cp(T), H°(T), S°(T) from NASA polynomial coefficients stored in SQLite

Project description

pyglenn — Thermochemical Properties Calculator

CI Docs License: MIT

Computes Cp(T), H°(T), S°(T) from NASA polynomial coefficients stored in a SQLite database, converted from FORTRAN thermo.inp files.

Author: Dr. Reginaldo G. Leão Jr. — prof.reginaldo.leao@gmail.com

📖 Documentation: profleao.github.io/pyglenn

Features

  • Parse NASA-format thermo.inp (FORTRAN Appendix C) → SQLite3 database
  • Query species by name, phase, molecular weight
  • Calculate Cp(T), H°(T), S°(T) at any valid temperature
  • Enthalpy of formation lookup
  • Enthalpy change between two temperatures
  • Command-line interface
  • ~2030 species, 3772 temperature intervals

Installation

From PyPI (pip)

pip install pyglenn

From source

git clone https://github.com/ProfLeao/pyglenn.git
cd pyglenn
pip install .

Conda

conda install conda-forge::pyglenn

Quick Start

The database is bundled with the package — no manual build step needed.

Python API

from pyglenn import ThermochemicalCalculator

# No need to specify a DB file — uses the bundled thermo.db
calc = ThermochemicalCalculator()
calc.connect()

# Find O2
species = calc.get_available_species('O2')
o2 = species[0]

# Calculate properties at 1000 K
props = calc.calculate_properties(o2['id'], 1000.0)
print(f"Cp = {props['cp']:.2f} J/(mol·K)")
print(f"H° = {props['h_relative']:.1f} J/mol")
print(f"S° = {props['s']:.3f} J/(mol·K)")

calc.close()

Or use the context manager for automatic cleanup:

from pyglenn import ThermochemicalCalculator

with ThermochemicalCalculator() as calc:
    species = calc.get_available_species('CH4')
    props = calc.calculate_properties(species[0]['id'], 500.0)
    print(f"Cp = {props['cp']:.2f} J/(mol·K)")

CLI

pyglenn query -s O2

Rebuilding the database

Only needed if the database is corrupted or you modify thermo.inp manually:

pyglenn build -i thermo.inp -o thermo.db

Database Structure

Table Description
species Chemical species (name, formula, phase, MW, ΔH°f)
temperature_intervals Valid T ranges per species
coefficients NASA-7 polynomial coefficients (a1–a7, b1, b2)
file_metadata Global file metadata

Citing

If you use pyglenn in your research, please cite it as:

@software{goncalves_leao_junior_2026_21324586,
  author    = {Gonçalves Leão Junior, Reginaldo},
  title     = {pyglenn: A Python Toolkit for Thermochemical
               Properties Calculation from NASA Polynomials},
  month     = jul,
  year      = 2026,
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.21324586},
  url       = {https://doi.org/10.5281/zenodo.21324586},
}

Requirements

  • Python ≥ 3.9
  • SQLite3 (stdlib)

License

MIT — see LICENSE file.

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

pyglenn-0.1.9.tar.gz (793.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyglenn-0.1.9-py3-none-any.whl (774.8 kB view details)

Uploaded Python 3

File details

Details for the file pyglenn-0.1.9.tar.gz.

File metadata

  • Download URL: pyglenn-0.1.9.tar.gz
  • Upload date:
  • Size: 793.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pyglenn-0.1.9.tar.gz
Algorithm Hash digest
SHA256 a5a04542633c83582a762c5c4215993d84291d0ce3e0c8c03b2de8c09742cf44
MD5 5ffaf914348adfe3dd6ec01952f1d9d5
BLAKE2b-256 8dfabfb1458d8ee79e8f9ed11d159135c943bed19a1382db03b411d2ad9e39a4

See more details on using hashes here.

File details

Details for the file pyglenn-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: pyglenn-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 774.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pyglenn-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 d2c6cb68fd8e670135d12b3d4bb1a2ca1c09996e1bb6fccf393f738bfc089a54
MD5 d3f48cbd3e44dda8f6fbedca929b66ba
BLAKE2b-256 262365b57fd5bbbc2e031a1ccc5ea69bc6976a0c7db6b6d3b59e823d9be7e165

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page