Skip to main content

Thermodiff

logo

thermodiff is a lightweight Python package designed to simplify the symbolic differentiation and manipulation of thermodynamic expressions using SymPy.

It was created to streamline everyday thermodynamic derivations with a clean and straightforward syntax tailored to practical research workflows.

While the package currently focuses on core, simple utility functions, suggestions and improvements are always welcome! If you have ideas for simple features that could be useful, feel free to open an issue or submit a pull request

Installation

Install the package from PyPI:

pip install thermodiff

Releases are published from the upstream repository ipqa-research/thermodiff.

To install the optional graphical front-end (see below):

pip install 'thermodiff[gui]'

For development, install from a clone of the repository in editable mode together with the development requirements:

pip install -e . -r requirements-dev.txt

Graphical front-end

An optional Streamlit application builds the model with buttons, editable tables and menus, compiling as you edit. It shows the generated Fortran module and a typeset preview of every derivative:

pip install 'thermodiff[gui]'
thermodiff-gui

Tutorial

On the tutorial you can check all the basics functionalities of this tool and an example of use.

See the GUI documentation.

Model files

Models can also be described in a small declarative .model file and compiled into a Fortran module with the function and all its derivatives:

thermodiff-model model.model -o model.f90

See the model files documentation and the corresponding tutorial.

Code generation presets

thermodiff-model, compile_model, compile_model_file, emit_module and the GUI take a preset of code-generation options:

  • minimal: the plain generator, the output of earlier versions.
  • standard (the default): the recommended set (chain rule, symmetry, loop nesting and sum sharing).
  • fastest: the fastest generated code in the met4 benchmark campaign, with slower generation and last-bit rounding differences.

Choose it with --preset on the command line or preset= in Python; individual flags and keyword arguments override the preset only when given. The gain of fastest comes from kernels specialised to one derivative set, so use it with optional_derivatives=False (the default); with optional_derivatives=True a warning lists the options that become inactive:

from thermodiff.model import compile_model

code = compile_model(text, derivatives="dn,dndn", preset="fastest")

Metadata

Release files for thermodiff 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thermodiff 2.0.0
File Size Uploaded Provenance Actions
thermodiff-2.0.0.tar.gz 153.7 kB With provenance Details for thermodiff-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for thermodiff 2.0.0
File Interpreter ABI Platform Actions
thermodiff-2.0.0-py3-none-any.whl Python 3 none any Details for thermodiff-2.0.0-py3-none-any.whl

Total release size: 314.5 kB

Release files / thermodiff-2.0.0.tar.gz

Download URL thermodiff-2.0.0.tar.gz
Size 153.7 kB
Tags Source
SHA-256 checksum
How to use checksums
352cd4335e1601438159f371cbdd2a235ece5824885888aa44ea6410f8a3b0fb
BLAKE2b-256 checksum
How to use checksums
05faa0fc6ecff14c597d0bf9a7f60d25a91395719ee24e06e505f424fa90baae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / thermodiff-2.0.0-py3-none-any.whl

Download URL thermodiff-2.0.0-py3-none-any.whl
Size 160.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24ce5716aa6a8a91c0a79f70c5e93e47f88d9c349ab4ea03b3a5a40fa87c50e6
BLAKE2b-256 checksum
How to use checksums
b3d3675e19642d40beba1dc51141c4dd288819f8182e6898bbac75f6b2ab45e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for thermodiff 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for thermodiff-2.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page