{"id":9843,"library":"janaf","title":"JANAF Thermochemical Tables Wrapper","description":"janaf is a Python wrapper for the NIST-JANAF Thermochemical Tables, providing programmatic access to thermodynamic data for various chemical species. The current version is 1.2.1, with releases occurring a few times a year, often including dependency updates and minor feature enhancements.","status":"active","version":"1.2.1","language":"en","source_language":"en","source_url":"https://github.com/n-takumasa/py-janaf","tags":["chemistry","thermodynamics","NIST","JANAF","data-science","materials-science"],"install":[{"cmd":"pip install janaf","lang":"bash","label":"Standard Install"},{"cmd":"pip install \"janaf[xarray]\"","lang":"bash","label":"Install with xarray support"}],"dependencies":[{"reason":"Core dependency for numerical operations.","package":"numpy","optional":false},{"reason":"Core dependency for data handling (DataFrames).","package":"pandas","optional":false},{"reason":"Required for the Table.to_xarray() method.","package":"xarray","optional":true}],"imports":[{"symbol":"get_table","correct":"from janaf import get_table"},{"symbol":"constants","correct":"from janaf import constants"}],"quickstart":{"code":"from janaf import get_table\n\n# Get thermochemical data for Water\nwater_table = get_table(\"H2O\")\n\n# Access data as a pandas DataFrame\nprint(\"\\nWater Table (first 5 rows):\\n\", water_table.df.head())\n\n# Access specific properties\nprint(f\"\\nEnthalpy (H) at 298.15 K: {water_table.df.loc[298.15, 'H/RT']} RT\")\n\n# Get data for another species\noxygen_table = get_table(\"O2\")\nprint(\"\\nOxygen Table (first 5 rows):\\n\", oxygen_table.df.head())","lang":"python","description":"This quickstart demonstrates how to fetch thermochemical data for a species (e.g., H2O) using `janaf.get_table()` and access the data as a pandas DataFrame. It also shows how to retrieve specific property values."},"warnings":[{"fix":"Upgrade Python to 3.9+ or use `pip install 'janaf<1.2.1'`.","message":"Python 3.8 support was dropped in `janaf` v1.2.1. If you are using Python 3.8 or older, you must either upgrade your Python version or pin `janaf` to a version older than 1.2.1.","severity":"breaking","affected_versions":">=1.2.1"},{"fix":"Update your code to explicitly handle `NaN` values (e.g., `dropna()`, `fillna()`, or manual interpolation) or ensure your data sources cover the full range of interest. Alternatively, pin `janaf` to `<1.1.0` if this imputation behavior is critical.","message":"As of v1.1.0, `janaf` no longer performs runtime imputation of missing data points (e.g., for `cp0/R`). If your code relied on these estimated values for certain species or temperature ranges, you might now encounter `NaN` values where data was previously provided.","severity":"breaking","affected_versions":">=1.1.0"},{"fix":"Install `janaf` with the `xarray` extra: `pip install \"janaf[xarray]\"` or install `xarray` separately: `pip install xarray`.","message":"The `Table.to_xarray()` method requires the optional `xarray` dependency to be installed. If `xarray` is not installed, calling this method will result in an `AttributeError`.","severity":"gotcha","affected_versions":">=1.2.0"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Install the package using pip: `pip install janaf`","cause":"The `janaf` package is not installed in your current Python environment.","error":"ModuleNotFoundError: No module named 'janaf'"},{"fix":"Install `janaf` with the `xarray` extra: `pip install \"janaf[xarray]\"` or install `xarray` directly: `pip install xarray`.","cause":"You are trying to use the `to_xarray()` method, but the `xarray` optional dependency is not installed.","error":"AttributeError: 'Table' object has no attribute 'to_xarray'"},{"fix":"Verify the exact species name and casing against standard NIST-JANAF nomenclature. For example, use 'H2O' instead of 'WATER'.","cause":"The species name provided to `janaf.get_table()` does not exactly match an entry in the NIST-JANAF Thermochemical Tables that `janaf` has access to.","error":"ValueError: No data found for species 'MY_INVALID_SPECIES'"},{"fix":"Explicitly handle `NaN` values in the DataFrame returned by `get_table()`. Use methods like `.dropna()`, `.fillna()`, or ensure type conversions are robust to `NaN`.","cause":"After `janaf` v1.1.0, missing data points are no longer imputed and appear as `NaN`. If your downstream code expects non-`NaN` numerical values or attempts to convert `NaN` floats to integers, this error can occur.","error":"TypeError: cannot convert float NaN to integer"}]}