pchemdb package¶

Physical Chemistry Database.

Submodules¶

pchemdb.crc module¶

Utilities for parsing CRC data.

Example: Parse CRC CSV into data structure

>>> from csv import DictReader
>>> from pchemdb.crc import parse_crc
>>> with Path(...).open(mode="r", encoding=...) as file:
...     reader = DictReader(file)
...     data = []
...     for row in reader:
...         data.extend(parse_crc)
pchemdb.crc.load_crc_database() list[tuple[dict[str, str], dict[str, list[str]], list[str]]][source]¶

Load the CRC database.

pchemdb.crc.parse_crc(d: dict[str, Any]) list[tuple[dict[str, Any], dict[str, list[tuple[str, str]]], list[tuple[str, str]]]][source]¶

Parse data from CRC.

Parameters:

d – A dictionary corresponding to a row in a CRC .csv file.

Returns:

A list of 3-tuples (solution, solute_data, solution_data), where each item represents a property entry. solution is a dictionary mapping pyEQL.solution.Solution constructor parameter names to their values. solute_data is a dictionary mapping solutes formulae to list of property-value pairs. solution_data is a list of property-value pairs.

pchemdb.utils module¶

Utilities for parsin molar conductivity data from CRC.

pchemdb.utils.condense(dataset: list[tuple[dict[str, str], dict[str, list[str]], list[str]]]) list[tuple[dict[str, str], dict[str, list[str]], list[str]]][source]¶

Condense a solution dataset.

Parameters:

dataset – A list of Solution, SoluteData, SolutionData 3-tuples.

# Should: Combine data with same anion and cation into single entry

pchemdb.utils.formula_to_salt(formula: str) Salt[source]¶

Convert a chemical formula into a Salt.

Parameters:

formula – A chemical formula written with the cation first (e.g., KCl, Na2SO4, etc.).

Warning

This function does not work for formulas with polyatomic cations other than NH4+.