CO2SYS

https://pyco2sys.readthedocs.io/en/latest/ CO2SYS is a family of software programs that calculate chemical equilibria for aquatic inorganic carbon species and parameters.

These programs are widely used by oceanographers and limnologists to understand and predict chemical equilibria in natural waters.

[2] CO2SYS was first published by Ernie Lewis and Doug Wallace in 1998 as a DOS-interface program written in QBasic.

[1][7] Development of the various CO2SYS programs continues as of 2021 with the addition of more chemical equilibrium parameters and compatibility with a wider range of environments, e.g. anoxic waters.

The relative amounts of each species in a body of water depends on physical variables including temperature and salinity, as well as chemical variables like pH and gas partial pressure.