![logo](logo.svg)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ipqa-research/ugropy/main)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://tldrlegal.com/license/mit-license)
![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-blue)
[![Docs](https://img.shields.io/badge/docs%20-%20green?style=flat&label=Sphinx&link=https%3A%2F%2Fipqa-research.github.io%2Fugropy%2Findex.html)](https://salvadorbrandolin.github.io/ugropy/)
[![PyPI
version](https://badge.fury.io/py/ugropy.svg)](https://badge.fury.io/py/ugropy)
`ugropy` is a `Python` library to obtain subgroups from different thermodynamic
group contribution models using both the name or the SMILES representation of a
molecule. If the name is given, the library uses the
[PubChemPy](https://github.com/mcs07/PubChemPy) library to obtain the SMILES
representation from PubChem. In both cases, `ugropy` uses the
[RDKit](https://github.com/rdkit/rdkit) library to search the functional groups
in the molecule.
`ugropy` is in an early development stage, leaving issues of examples of
molecules that `ugropy` fails solving the subgroups of a model is very helpful.
`ugropy` is tested for `Python` 3.10, 3.11 and 3.12 on Linux, Windows and Mac
OS.
## Try ugropy now
You can try ugropy from its
[Binder](https://mybinder.org/v2/gh/ipqa-research/ugropy/main). Open the
binder.ipynb file to explore the basic features.
## Models supported v2.0.5
- Classic liquid-vapor UNIFAC
- Predictive Soave-Redlich-Kwong (PSRK)
- Joback
## Writers
`ugropy` allows you to convert the obtained functional groups or estimated
properties to the input format required by the following thermodynamic
libraries:
- [Clapeyron.jl](github.com/ClapeyronThermo/Clapeyron.jl)
- [Thermo](https://github.com/CalebBell/thermo)
## Example of use
You can check the full tutorial
[here](https://ipqa-research.github.io/ugropy/tutorial/tutorial.html).
Get groups from the molecule's name:
```python
from ugropy import Groups
hexane = Groups("hexane")
print(hexane.unifac.subgroups)
print(hexane.psrk.subgroups)
print(hexane.joback.subgroups)
```
{'CH3': 2, 'CH2': 4}
{'CH3': 2, 'CH2': 4}
{'-CH3': 2, '-CH2-': 4}
Get groups from molecule's SMILES:
```python
propanol = Groups("CCCO", "smiles")
print(propanol.unifac.subgroups)
print(propanol.psrk.subgroups)
print(propanol.joback.subgroups)
```
{'CH3': 1, 'CH2': 2, 'OH': 1}
{'CH3': 1, 'CH2': 2, 'OH': 1}
{'-CH3': 1, '-CH2-': 2, '-OH (alcohol)': 1}
Estimate properties with the Joback model!
```python
limonene = Groups("limonene")
print(limonene.joback.subgroups)
print(f"{limonene.joback.critical_temperature} K")
print(f"{limonene.joback.vapor_pressure(176 + 273.15)} bar")
```
{'-CH3': 2, '=CH2': 1, '=C<': 1, 'ring-CH2-': 3, 'ring>CH-': 1, 'ring=CH-': 1, 'ring=C<': 1}
657.4486692170663 K
1.0254019428522743 bar
Visualize your results! (The next code creates the `ugropy` logo)
```Python
from IPython.display import SVG
mol = Groups("CCCC1=C(COC(C)(C)COC(=O)OCC)C=C(CC2=CC=CC=C2)C=C1", "smiles")
svg = mol.unifac.draw(
title="ugropy",
width=800,
height=450,
title_font_size=50,
legend_font_size=14
)
SVG(svg)
```
Write down the [Clapeyron.jl](https://github.com/ClapeyronThermo/Clapeyron.jl)
.csv input files.
```python
from ugropy import writers
names = ["limonene", "adrenaline", "Trinitrotoluene"]
grps = [Groups(n) for n in names]
# Write the csv files into a database directory
writers.to_clapeyron(
molecules_names=names,
unifac_groups=[g.unifac.subgroups for g in grps],
psrk_groups=[g.psrk.subgroups for g in grps],
joback_objects=[g.joback for g in grps],
path="database"
)
```
Obtain the [Caleb Bell's Thermo](https://github.com/CalebBell/thermo) subgroups
```python
from ugropy import unifac
names = ["hexane", "2-butanone"]
grps = [Groups(n) for n in names]
[writers.to_thermo(g.unifac.subgroups, unifac) for g in grps]
```
```
[{1: 2, 2: 4}, {1: 1, 2: 1, 18: 1}]
```
## Installation
```
pip install ugropy
```
Raw data
{
"_id": null,
"home_page": null,
"name": "ugropy",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "UNIFAC, functional group, thermodynamics, chemical engineering",
"author": null,
"author_email": "\"Brandol\u00edn, Salvador Eduardo\" <salvadorebrandolin@mi.unc.edu.ar>",
"download_url": "https://files.pythonhosted.org/packages/bc/89/f6d98a834c5c736a9c0a55babcfbb89d0b5d4fa2051900ecb91474ef766a/ugropy-2.0.5.tar.gz",
"platform": null,
"description": "![logo](logo.svg)\n\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ipqa-research/ugropy/main)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://tldrlegal.com/license/mit-license)\n![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-blue)\n[![Docs](https://img.shields.io/badge/docs%20-%20green?style=flat&label=Sphinx&link=https%3A%2F%2Fipqa-research.github.io%2Fugropy%2Findex.html)](https://salvadorbrandolin.github.io/ugropy/)\n[![PyPI\nversion](https://badge.fury.io/py/ugropy.svg)](https://badge.fury.io/py/ugropy)\n\n`ugropy` is a `Python` library to obtain subgroups from different thermodynamic\ngroup contribution models using both the name or the SMILES representation of a\nmolecule. If the name is given, the library uses the\n[PubChemPy](https://github.com/mcs07/PubChemPy) library to obtain the SMILES\nrepresentation from PubChem. In both cases, `ugropy` uses the\n[RDKit](https://github.com/rdkit/rdkit) library to search the functional groups\nin the molecule.\n\n`ugropy` is in an early development stage, leaving issues of examples of\nmolecules that `ugropy` fails solving the subgroups of a model is very helpful.\n\n`ugropy` is tested for `Python` 3.10, 3.11 and 3.12 on Linux, Windows and Mac\nOS.\n\n## Try ugropy now\nYou can try ugropy from its\n[Binder](https://mybinder.org/v2/gh/ipqa-research/ugropy/main). Open the\nbinder.ipynb file to explore the basic features.\n\n## Models supported v2.0.5\n- Classic liquid-vapor UNIFAC\n- Predictive Soave-Redlich-Kwong (PSRK)\n- Joback\n\n## Writers\n`ugropy` allows you to convert the obtained functional groups or estimated\nproperties to the input format required by the following thermodynamic\nlibraries:\n\n- [Clapeyron.jl](github.com/ClapeyronThermo/Clapeyron.jl)\n- [Thermo](https://github.com/CalebBell/thermo)\n\n\n## Example of use\nYou can check the full tutorial\n[here](https://ipqa-research.github.io/ugropy/tutorial/tutorial.html).\n\nGet groups from the molecule's name:\n\n\n```python\nfrom ugropy import Groups\n\n\nhexane = Groups(\"hexane\")\n\nprint(hexane.unifac.subgroups)\nprint(hexane.psrk.subgroups)\nprint(hexane.joback.subgroups)\n```\n\n {'CH3': 2, 'CH2': 4}\n {'CH3': 2, 'CH2': 4}\n {'-CH3': 2, '-CH2-': 4}\n\nGet groups from molecule's SMILES:\n\n```python\npropanol = Groups(\"CCCO\", \"smiles\")\n\nprint(propanol.unifac.subgroups)\nprint(propanol.psrk.subgroups)\nprint(propanol.joback.subgroups)\n```\n\n {'CH3': 1, 'CH2': 2, 'OH': 1}\n {'CH3': 1, 'CH2': 2, 'OH': 1}\n {'-CH3': 1, '-CH2-': 2, '-OH (alcohol)': 1}\n\nEstimate properties with the Joback model!\n\n```python\nlimonene = Groups(\"limonene\")\n\nprint(limonene.joback.subgroups)\nprint(f\"{limonene.joback.critical_temperature} K\")\nprint(f\"{limonene.joback.vapor_pressure(176 + 273.15)} bar\")\n```\n\n {'-CH3': 2, '=CH2': 1, '=C<': 1, 'ring-CH2-': 3, 'ring>CH-': 1, 'ring=CH-': 1, 'ring=C<': 1}\n 657.4486692170663 K\n 1.0254019428522743 bar\n\nVisualize your results! (The next code creates the `ugropy` logo)\n\n```Python\nfrom IPython.display import SVG\n\nmol = Groups(\"CCCC1=C(COC(C)(C)COC(=O)OCC)C=C(CC2=CC=CC=C2)C=C1\", \"smiles\")\n\nsvg = mol.unifac.draw(\n title=\"ugropy\",\n width=800,\n height=450,\n title_font_size=50,\n legend_font_size=14\n)\n\nSVG(svg)\n```\n\nWrite down the [Clapeyron.jl](https://github.com/ClapeyronThermo/Clapeyron.jl)\n.csv input files.\n\n```python\nfrom ugropy import writers\n\nnames = [\"limonene\", \"adrenaline\", \"Trinitrotoluene\"]\n\ngrps = [Groups(n) for n in names]\n\n# Write the csv files into a database directory\nwriters.to_clapeyron(\n molecules_names=names,\n unifac_groups=[g.unifac.subgroups for g in grps],\n psrk_groups=[g.psrk.subgroups for g in grps],\n joback_objects=[g.joback for g in grps],\n path=\"database\"\n)\n```\nObtain the [Caleb Bell's Thermo](https://github.com/CalebBell/thermo) subgroups\n\n```python\nfrom ugropy import unifac\n\nnames = [\"hexane\", \"2-butanone\"]\n\ngrps = [Groups(n) for n in names]\n\n[writers.to_thermo(g.unifac.subgroups, unifac) for g in grps]\n```\n\n```\n[{1: 2, 2: 4}, {1: 1, 2: 1, 18: 1}]\n```\n\n## Installation\n```\npip install ugropy\n```\n",
"bugtrack_url": null,
"license": "The MIT License",
"summary": "Get UNIFAC functional groups of PubChem compounds or SMILES representation.",
"version": "2.0.5",
"project_urls": {
"Homepage": "https://github.com/ipqa-research/ugropy"
},
"split_keywords": [
"unifac",
" functional group",
" thermodynamics",
" chemical engineering"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a3d66286b908690797305185abb33cd0cbc09a722d23b68a28be846a904bd579",
"md5": "3d2bdce75ba703b0a4391e84f6168312",
"sha256": "cc7b981cebbc6c839d95985bebe52835183b47be1e9c8a20e00aa432ec10ad5c"
},
"downloads": -1,
"filename": "ugropy-2.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3d2bdce75ba703b0a4391e84f6168312",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 55211,
"upload_time": "2024-04-24T02:31:00",
"upload_time_iso_8601": "2024-04-24T02:31:00.400372Z",
"url": "https://files.pythonhosted.org/packages/a3/d6/6286b908690797305185abb33cd0cbc09a722d23b68a28be846a904bd579/ugropy-2.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bc89f6d98a834c5c736a9c0a55babcfbb89d0b5d4fa2051900ecb91474ef766a",
"md5": "988ee4b24930eca12e316d65bc5d1a09",
"sha256": "7613b5018b1eb1b0e51fff8e825f3fca8b73da2adaf6677c1af3ee5bd27c2044"
},
"downloads": -1,
"filename": "ugropy-2.0.5.tar.gz",
"has_sig": false,
"md5_digest": "988ee4b24930eca12e316d65bc5d1a09",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 42716,
"upload_time": "2024-04-24T02:31:02",
"upload_time_iso_8601": "2024-04-24T02:31:02.903646Z",
"url": "https://files.pythonhosted.org/packages/bc/89/f6d98a834c5c736a9c0a55babcfbb89d0b5d4fa2051900ecb91474ef766a/ugropy-2.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-24 02:31:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ipqa-research",
"github_project": "ugropy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "numpy",
"specs": [
[
">=",
"1.25.1"
]
]
},
{
"name": "pandas",
"specs": [
[
">=",
"2.0.3"
]
]
},
{
"name": "pubchempy",
"specs": [
[
"==",
"1.0.4"
]
]
},
{
"name": "rdkit",
"specs": [
[
"==",
"2023.9.5"
]
]
}
],
"tox": true,
"lcname": "ugropy"
}