{"id":23421,"library":"chemicals","title":"chemicals","description":"Chemical properties component of the Chemical Engineering Design Library (ChEDL). Provides pure component and mixture properties, phase equilibria, transport properties, and reaction stoichiometry. Current version 1.5.1, released regularly.","status":"active","version":"1.5.1","language":"python","source_language":"en","source_url":"https://github.com/CalebBell/chemicals","tags":["chemical-engineering","thermodynamics","physical-properties","property-estimation"],"install":[{"cmd":"pip install chemicals","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used for fluid dynamics calculations; version >= 1.0.26 required since chemicals 1.2.0","package":"fluids","optional":false},{"reason":"Array computations","package":"numpy","optional":false},{"reason":"Interpolation and optimization","package":"scipy","optional":false}],"imports":[{"note":"Chemical is a class inside the chemicals package","wrong":"import Chemical","symbol":"Chemical","correct":"from chemicals import Chemical"},{"note":"Submodule not directly exported","wrong":"from chemicals import VaporPressure","symbol":"VaporPressure","correct":"from chemicals.vapor_pressure import VaporPressure"},{"note":"flash is a function in chemicals.flash","wrong":"import flash","symbol":"flash","correct":"from chemicals.flash import flash"},{"note":"tetens is a function in vapor_pressure submodule","wrong":"from chemicals import tetens","symbol":"tetens","correct":"from chemicals.vapor_pressure import tetens"}],"quickstart":{"code":"from chemicals import Chemical\nfrom chemicals.reaction import balance_stoichiometry\n\n# Create a chemical object for water\nH2O = Chemical('water')\nprint(f\"Molecular weight: {H2O.MW} g/mol\")\nprint(f\"Critical temperature: {H2O.Tc} K\")\n\n# Balance a simple reaction\nrxn = balance_stoichiometry(['H2', 'O2'], ['H2O'])\nprint(f\"Balanced: {rxn}\")","lang":"python","description":"Basic usage: instantiate a Chemical and compute properties."},"warnings":[{"fix":"Always specify a unique CAS number if possible, e.g., Chemical(CAS='64-17-5').","message":"Chemical names can be ambiguous. Use CAS numbers or exact names to avoid picking the wrong isomer. e.g., 'ethanol' vs 'ethyl alcohol' both work, but 'propanol' raises an error due to multiple isomers.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade chemicals to 1.3.0+ or pin numpy<2.0. For chemicals 1.2.0, ensure numpy 2.0 and scipy 1.14 compatibility is acceptable.","message":"In version 1.2.0, numpy 2.0 and scipy 1.14 compatibility introduced breaking changes for some internal routines. Old code relying on numpy <2.0 may break.","severity":"breaking","affected_versions":">=1.2.0,<1.3.0"},{"fix":"Run pip install 'chemicals' which auto-installs correct fluids version.","message":"The 'chemicals' package uses the 'fluids' library as a dependency. If you installed it via pip, fluids is included, but if you manually install chemicals from source, ensure fluids >= 1.0.26 (since chemicals 1.2.0).","severity":"gotcha","affected_versions":">=1.2.0"},{"fix":"Use method as integer or use the new VaporPressure class directly.","message":"The function 'VaporPressure.from_method' using deprecated argument 'method' with string names might be removed. Use integer or method handle instead.","severity":"deprecated","affected_versions":">=1.4.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: pip install chemicals","cause":"The package is not installed.","error":"ModuleNotFoundError: No module named 'chemicals'"},{"fix":"Use a valid name, CAS, or formula. For water, you can use 'water', '7732-18-5', or 'H2O'.","cause":"Chemical name not found in the database. 'water' is correct, but misspelled names or uncommon synonyms may fail.","error":"KeyError: 'water'"},{"fix":"from chemicals import Chemical","cause":"Incorrect import pattern. Chemical is not directly on the chemicals module; it is a class that must be imported explicitly.","error":"AttributeError: module 'chemicals' has no attribute 'Chemical'"},{"fix":"Use a more specific name like '1-propanol' or 'isopropanol', or specify CAS number.","cause":"The name is ambiguous (1-propanol vs 2-propanol).","error":"ValueError: Could not find unique CAS for 'propanol'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}