{"id":15063779,"url":"https://github.com/chicolucio/ph-diagrams","last_synced_at":"2025-04-10T11:25:51.745Z","repository":{"id":46717357,"uuid":"367147962","full_name":"chicolucio/pH-diagrams","owner":"chicolucio","description":"A Python package to plot fractional composition diagrams and pH-log c diagrams","archived":false,"fork":false,"pushed_at":"2022-08-01T18:37:17.000Z","size":3364,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T22:46:46.435Z","etag":null,"topics":["analytical-chemistry","chemistry","physical-chemistry","python","speciation","streamlit","streamlit-webapp"],"latest_commit_sha":null,"homepage":"https://phdiagrams.herokuapp.com/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chicolucio.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.rst","funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"chicolucio"}},"created_at":"2021-05-13T19:02:59.000Z","updated_at":"2023-06-27T14:33:53.000Z","dependencies_parsed_at":"2022-08-20T12:10:13.181Z","dependency_job_id":null,"html_url":"https://github.com/chicolucio/pH-diagrams","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicolucio%2FpH-diagrams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicolucio%2FpH-diagrams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicolucio%2FpH-diagrams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicolucio%2FpH-diagrams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chicolucio","download_url":"https://codeload.github.com/chicolucio/pH-diagrams/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208621,"owners_count":21065203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytical-chemistry","chemistry","physical-chemistry","python","speciation","streamlit","streamlit-webapp"],"created_at":"2024-09-25T00:07:10.968Z","updated_at":"2025-04-10T11:25:51.730Z","avatar_url":"https://github.com/chicolucio.png","language":"Jupyter Notebook","funding_links":["https://github.com/sponsors/chicolucio"],"categories":[],"sub_categories":[],"readme":".. image:: https://img.shields.io/badge/Author-Francisco%20Bustamante-red.svg\n    :alt: Francisco Bustamante\n    :target: https://www.linkedin.com/in/flsbustamante\n.. image:: https://img.shields.io/badge/Python-3.8+-blue.svg\n    :alt: Python\n    :target: https://www.python.org/\n.. image:: https://img.shields.io/badge/License-MIT-blue.svg\n    :alt: LICENSE\n    :target: LICENSE.txt\n.. image:: https://img.shields.io/badge/Contributions-Welcome-brightgreen.svg?style=flat\n    :alt: Contributions are welcome\n    :target: https://github.com/chicolucio/pH-diagrams/issues\n.. image:: https://img.shields.io/badge/-PyScaffold-005CA0?logo=pyscaffold\n    :alt: Project generated with PyScaffold\n    :target: https://pyscaffold.org/\n.. image:: https://readthedocs.org/projects/ph-diagrams/badge/?version=latest\n    :target: https://ph-diagrams.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n.. image:: https://img.shields.io/pypi/v/pH-diagrams.svg\n    :alt: PyPI-Server\n    :target: https://pypi.org/project/pH-diagrams/\n\n===========\npH diagrams\n===========\n\n    A Python package to plot fractional composition diagrams and pH-log c diagrams\n\n.. image:: https://github.com/chicolucio/pH-diagrams/blob/master/images/animation.gif?raw=true\n    :alt: header animation\n    :align: center\n\n|\n\nInteractive web app:\n\n.. image:: https://img.shields.io/badge/-Streamlit%20app-FF4B4B?style=for-the-badge\u0026logo=Streamlit\u0026logoColor=white\n    :alt: Streamlit app\n    :align: center\n    :target: https://phdiagrams.herokuapp.com/\n\nInstallation\n============\n\n::\n\n   pip install pH-diagrams\n\nUsage\n=====\n\nThe class ``Acid`` must be imported from ``ph_diagrams``. To create diagrams for the\nacetic acid::\n\n   \u003e\u003e\u003e from ph_diagrams import Acid\n   \u003e\u003e\u003e import matplotlib.pyplot as plt\n   \u003e\u003e\u003e fig, axs = plt.subplots(nrows=1, ncols=2)\n   \u003e\u003e\u003e acetic_acid = Acid(pKa=(4.76,), acid_concentration=0.1)\n   \u003e\u003e\u003e acetic_acid.plot(plot_type='distribution', backend='matplotlib',\n                        title='Acetic acid - Distribution diagram',\n                        ax=axs[0], legend=False)\n   \u003e\u003e\u003e acetic_acid.plot(plot_type='pC', backend='matplotlib',\n                        title='Acetic acid - pH-log c diagram', ax=axs[1])\n   \u003e\u003e\u003e plt.show()\n\nAs can be seen, the parameter ``pKa`` must be a tuple even if there is only one value.\nThe above example generates the following plot, with both diagrams side by side:\n\n.. image:: https://github.com/chicolucio/pH-diagrams/blob/master/images/acetic_acid.png?raw=true\n    :alt: acetic acid example\n    :align: center\n\nThe plots above were made with Matplotlib_, the default backend.\n\nChanging the ``backend`` parameter to ``plotly``, and removing the ``ax`` parameter\n(it works only with Matplotlib), will open a browser window for each plot.\nSince Plotly_ is interactive, the user can zoom, pan, and see values on hover.\n\nFull documentation is hosted on `Read the Docs`_.\n\nA live interactive version of this project can be seen clicking in the following badge:\n\n.. image:: https://img.shields.io/badge/-Streamlit%20app-FF4B4B?style=for-the-badge\u0026logo=Streamlit\u0026logoColor=white\n    :alt: Streamlit app\n    :align: center\n    :target: https://phdiagrams.herokuapp.com/\n\nThe web app was made with Streamlit_ and hosted on Heroku_.\n\nA brief explanation on the chemical theory behind each diagram can be seen\n`here \u003chttps://phdiagrams.herokuapp.com/How_to_use_and_theory\u003e`_.\n\nLocal Streamlit app and Jupyter notebooks\n-----------------------------------------\n\nThis repo has Jupyter Notebooks and scripts for a fully functional\nStreamlit_ app. First, create a virtual environment, clone the repo and\ninstall dependencies::\n\n    python -m venv .venv\n    source .venv/bin/activate\n    git clone git@github.com:chicolucio/pH-diagrams.git\n    cd pH-diagrams\n    pip install -r requirements.txt\n\nThis considers that you have `Jupyter Notebook`_ installed. If not, install it with\n``pip install notebook``.\n\nFor more basic usage examples, see the ``tutorial.ipynb`` notebook on ``notebooks`` folder.\nIn the same folder, the ``tutorial_interactive_ipywidgets.ipynb`` file shows how to\nuse ipywidgets_ to create interactive diagrams. Just run ``jupyter notebook`` on a\nterminal from the repo root folder and select the files.\n\nA local version of the Streamlit_ app can be used running, from the repo root folder,\n``streamlit run Home.py`` on a terminal. A browser window will open (if not, follow\nthe instructions shown on the terminal output).\n\nContributing\n============\n\nAll contributions are welcome.\n\n**Issues**\n\nFeel free to submit issues regarding:\n\n- recommendations\n- more examples for the tutorial\n- enhancement requests and new useful features\n- code bugs\n\n**Pull requests**\n\n- before starting to work on your pull request, please submit an issue first\n- fork the repo\n- clone the project to your own machine\n- commit changes to your own branch\n- push your work back up to your fork\n- submit a pull request so that your changes can be reviewed\n\nFor full contribution guidelines and details check out our `contributing guide`_.\n\n\n\nCiting\n======\n\nIf you use this project in a scientific publication or in classes, please consider citing as\n\n   F. L. S. Bustamante \u0026 H. B. Soares \u0026 N. O. Souza, pH diagrams, 2021.\n   Available at: https://github.com/chicolucio/pH-diagrams\n\n.. _Matplotlib: https://matplotlib.org\n.. _Streamlit: https://streamlit.io\n.. _Heroku: https://www.heroku.com\n.. _Plotly: https://plotly.com/python/\n.. _contributing guide: CONTRIBUTING.rst\n.. _Read the Docs: https://ph-diagrams.readthedocs.io/en/latest/?badge=latest\n.. _ipywidgets: https://ipywidgets.readthedocs.io/en/stable/\n.. _Jupyter Notebook: https://jupyter.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchicolucio%2Fph-diagrams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchicolucio%2Fph-diagrams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchicolucio%2Fph-diagrams/lists"}