{"id":19671221,"url":"https://github.com/cgohlke/molmass","last_synced_at":"2025-05-07T21:28:40.499Z","repository":{"id":54833146,"uuid":"242421823","full_name":"cgohlke/molmass","owner":"cgohlke","description":"Molecular mass calculations","archived":false,"fork":false,"pushed_at":"2024-05-23T19:54:41.000Z","size":500,"stargazers_count":56,"open_issues_count":1,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-19T04:39:05.035Z","etag":null,"topics":["chemistry","mass-spectrometry","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/molmass","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cgohlke.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-22T22:39:48.000Z","updated_at":"2024-09-04T14:51:06.000Z","dependencies_parsed_at":"2022-08-14T04:10:50.549Z","dependency_job_id":"c40a1292-3b64-40a2-bc32-ce49c3995821","html_url":"https://github.com/cgohlke/molmass","commit_stats":{"total_commits":82,"total_committers":2,"mean_commits":41.0,"dds":"0.35365853658536583","last_synced_commit":"674ee54ff4dcb8ded0b05503615fdf0da5f93ec0"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgohlke%2Fmolmass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgohlke%2Fmolmass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgohlke%2Fmolmass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgohlke%2Fmolmass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgohlke","download_url":"https://codeload.github.com/cgohlke/molmass/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231461743,"owners_count":18380303,"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":["chemistry","mass-spectrometry","python"],"created_at":"2024-11-11T17:08:11.123Z","updated_at":"2025-05-07T21:28:40.487Z","avatar_url":"https://github.com/cgohlke.png","language":"Python","funding_links":[],"categories":["General Chemistry"],"sub_categories":[],"readme":"..\n  This file is generated by setup.py\n\nMolecular mass calculations\n===========================\n\nMolmass is a Python library, console script, and web application to calculate\nthe molecular mass (average, nominal, and isotopic pure), the elemental\ncomposition, and the mass distribution spectrum of a molecule given by its\nchemical formula, relative element weights, or sequence.\n\nCalculations are based on the isotopic composition of the elements. Mass\ndeficiency due to chemical bonding is not taken into account.\n\nThe library includes a database of physicochemical and descriptive properties\nof the chemical elements.\n\n:Author: `Christoph Gohlke \u003chttps://www.cgohlke.com\u003e`_\n:License: BSD 3-Clause\n:Version: 2025.4.14\n:DOI: `10.5281/zenodo.7135495 \u003chttps://doi.org/10.5281/zenodo.7135495\u003e`_\n\nQuickstart\n----------\n\nInstall the molmass package and all dependencies from the\n`Python Package Index \u003chttps://pypi.org/project/molmass/\u003e`_::\n\n    python -m pip install -U \"molmass[all]\"\n\nPrint the console script usage::\n\n    python -m molmass --help\n\nRun the web application::\n\n    python -m molmass --web\n\nThe molmass library is documented via docstrings.\n\nSee `Examples`_ for using the programming interface.\n\nSource code and support are available on\n`GitHub \u003chttps://github.com/cgohlke/molmass\u003e`_.\n\nRequirements\n------------\n\nThis revision was tested with the following requirements and dependencies\n(other versions may work):\n\n- `CPython \u003chttps://www.python.org\u003e`_ 3.10.11, 3.11.9, 3.12.10, 3.13.3\n- `Flask \u003chttps://pypi.org/project/Flask/\u003e`_ 3.1.0 (optional)\n- `Pandas \u003chttps://pypi.org/project/pandas/\u003e`_ 2.2.3 (optional)\n- `wxPython \u003chttps://pypi.org/project/wxPython/\u003e`_ 4.2.3 (optional)\n\nRevisions\n---------\n\n2025.4.14\n\n- Add mass_charge_ratio helper function (#17).\n- Drop support for Python 3.9.\n\n2024.10.25\n\n- Fix composition of formula with multiple isotopes of same element (#16).\n\n2024.5.24\n\n- Fix docstring examples not correctly rendered on GitHub.\n\n2024.5.10\n\n- Add options to disable parsing groups, oligos, fractions, arithmetic (#14).\n- Add Formula.expanded property.\n\n2023.8.30\n\n- Fix linting issues.\n- Add py.typed marker.\n- Drop support for Python 3.8.\n\n2023.4.10\n\n- Support rdkit-style ionic charges (#11, #12).\n- Enable multiplication without addition in from_string.\n\n2022.12.9\n\n- Fix split_charge formula with trailing ]] (#11).\n\n2022.10.18\n\n- Several breaking changes.\n- Add experimental support for ion charges (#5).\n- Change Element, Isotope, and Particle to dataclass (breaking).\n- Change types of Spectrum and Composition (breaking).\n- Add functions to export Spectrum and Composition as Pandas DataFrames.\n- Replace lazyattr with functools.cached_property.\n- Rename molmass_web to web (breaking).\n- Change output of web application (breaking).\n- Run web application using Flask if installed.\n- Add options to specify URL of web application and not opening web browser.\n- Convert to Google style docstrings.\n- Add type hints.\n- Drop support for Python 3.7.\n\n2021.6.18\n\n- Add Particle types to elements (#5).\n- Fix molmass_web failure on WSL2 (#9).\n- Fix elements_gui layout issue.\n- Drop support for Python 3.6.\n\n2020.6.10\n\n- Fix elements_gui symbol size on WSL2.\n- Support wxPython 4.1.\n\n2020.1.1\n\n- Update elements atomic weights and isotopic compositions from NIST.\n- Move element descriptions into separate module.\n- Drop support for Python 2.7 and 3.5.\n\n2018.8.15\n\n- Move modules into molmass package.\n\n2018.5.29\n\n- Add option to start web interface from console.\n- Separate styles from content and use CSS flex layout in molmass_web.\n\n2018.5.25\n\n- Style and docstring fixes.\n- Make from_fractions output deterministic.\n- Accept Flask request.args in molmass_web.\n- Style and template changes in molmass_web.\n\n2016.2.25\n\n- Fix some elements ionization energies.\n\n2005.x.x\n\n- Initial release.\n\nExamples\n--------\n\nCalculate the molecular mass, elemental composition, and mass distribution of\na molecule from its chemical formula:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from molmass import Formula\n    \u003e\u003e\u003e f = Formula('C8H10N4O2')  # Caffeine\n    \u003e\u003e\u003e f\n    Formula('C8H10N4O2')\n    \u003e\u003e\u003e f.formula  # hill notation\n    'C8H10N4O2'\n    \u003e\u003e\u003e f.empirical\n    'C4H5N2O'\n    \u003e\u003e\u003e f.mass  # average mass\n    194.1909...\n    \u003e\u003e\u003e f.nominal_mass  # == f.isotope.massnumber\n    194\n    \u003e\u003e\u003e f.monoisotopic_mass  # == f.isotope.mass\n    194.0803...\n    \u003e\u003e\u003e f.atoms\n    24\n    \u003e\u003e\u003e f.charge\n    0\n    \u003e\u003e\u003e f.composition().dataframe()\n             Count  Relative mass  Fraction\n    Element...\n    C            8      96.085920  0.494801\n    H           10      10.079410  0.051905\n    N            4      56.026812  0.288514\n    O            2      31.998810  0.164780\n    \u003e\u003e\u003e f.spectrum(min_intensity=0.01).dataframe()\n                 Relative mass  Fraction  Intensity %         m/z\n    Mass number...\n    194             194.080376  0.898828   100.000000  194.080376\n    195             195.082873  0.092625    10.305100  195.082873\n    196             196.084968  0.008022     0.892492  196.084968\n    197             197.087214  0.000500     0.055681  197.087214\n\nAccess physicochemical and descriptive properties of the chemical elements:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from molmass import ELEMENTS, Element\n    \u003e\u003e\u003e e = ELEMENTS['C']\n    \u003e\u003e\u003e e\n    Element(\n        6, 'C', 'Carbon',\n        group=14, period=2, block='p', series=1,\n        mass=12.01074, eleneg=2.55, eleaffin=1.262118,\n        covrad=0.77, atmrad=0.91, vdwrad=1.7,\n        tboil=5100.0, tmelt=3825.0, density=3.51,\n        eleconfig='[He] 2s2 2p2',\n        oxistates='4*, 2, -4*',\n        ionenergy=(\n            11.2603, 24.383, 47.877, 64.492, 392.077,\n            489.981,\n        ),\n        isotopes={\n            12: Isotope(12.0, 0.9893, 12),\n            13: Isotope(13.00335483507, 0.0107, 13),\n        },\n    )\n    \u003e\u003e\u003e e.number\n    6\n    \u003e\u003e\u003e e.symbol\n    'C'\n    \u003e\u003e\u003e e.name\n    'Carbon'\n    \u003e\u003e\u003e e.description\n    'Carbon is a member of group 14 of the periodic table...'\n    \u003e\u003e\u003e e.eleconfig\n    '[He] 2s2 2p2'\n    \u003e\u003e\u003e e.eleconfig_dict\n    {(1, 's'): 2, (2, 's'): 2, (2, 'p'): 2}\n    \u003e\u003e\u003e str(ELEMENTS[6])\n    'Carbon'\n    \u003e\u003e\u003e len(ELEMENTS)\n    109\n    \u003e\u003e\u003e sum(e.mass for e in ELEMENTS)\n    14693.181589001...\n    \u003e\u003e\u003e for e in ELEMENTS:\n    ...     e.validate()\n    ...     e = eval(repr(e))\n    ...","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgohlke%2Fmolmass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgohlke%2Fmolmass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgohlke%2Fmolmass/lists"}