chemeq


Namechemeq JSON
Version 0.1.7 PyPI version JSON
download
home_pagehttps://github.com/elbiop/chemeq
SummaryBalance chemical equations & calculates molecular weights plus periodic table of elements
upload_time2023-04-18 09:42:39
maintainer
docs_urlNone
authorElbio Peña
requires_python>= 3.6
license
keywords chemistry chemical chemicals equation equations balance balancer balancing reaction reactions periodic table elements
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
Package capable of balance chemical equations and contains the most used portion of the periodic table of elements.   
The package has two objects: **chemeq** and **periodic_table**.   

### 1. chemeq   
  CLASS, Receives a string representing a chemical equation  as input.   
  In the shape: "reactant_1 + ... + reactant_n  = product_1 + ... + product_n".   

  The **chemeq CLASS** has three properties and one method.   

        **is_balanced** : Property. Boolean (True or False)   
        **reactants**  : Property. pandas.DtataFrame where each row represents one of the reactants (left side)   
           compounds,  molecular weights and elements.   
        **products**   : Property. pandas.DtataFrame where each row represents one of the product (right side)   
           compounds, molecular weights and elements.   
        **balance()**   : Method. Balances the equation if it is unbalanced.   


### 2. periodic_table   
   pandas.DataFrame containing a portion of the periodic table of elements contains: Z, name, symbol, atomic mass,   
   atomic mass error, period, group & state.   

      Source for the periodic table of elements:   
      IUPAC - International Union of Pure and Applied Chemistry   
      https://iupac.org/what-we-do/periodic-table-of-elements/   

## LIMITATIONS   
- Does not include Rare earths, synthetic elements, Radon, Francium & Radium.   
- Intermediate prefixes like those from hydrates such as Cu(SO4)•5H2O   
  must be represented with subindexes like Cu(SO4)(H2O)5.   

## EXAMPLES   
```
  >>> from chemeq import chemeq
  >>> eq = chemeq("C2H5(OH) + O2 = CO2 + H2O")
  >>> eq.is_balanced
  False
```
  The balance status of the equation is also visible in the equation object itself.
```
  >>> eq
  <Unbalanced equation: "C2H5(OH) + O2 = CO2 + H2O">
```
  To balance the equation invoke the balance() method
```
>>> eq.balance()
  >>> eq.is_balanced
  True
  >>> eq
  <Balanced equation: "C2H5(OH) + 3O2 = 2CO2 + 3H2O">
```
Example of its properties
```
  >>> str(eq)
  "C2H5(OH) + 3O2 = 2CO2 + 3H2O"
  >>> eq.reactants
     coefficient   formula  C  H  O  Mass(g/mol)
  0            1  C2H5(OH)  2  6  1       46.069
  1            3        O2  0  0  2       31.998
  >>> eq.products
     coefficient formula  C  H  O  Mass(g/mol)
  0            2     CO2  1  0  2       44.009
  1            3     H2O  0  2  1       18.015</pre>
```

  An equation can be created with their indexes to test if it is balanced. If it is not it can be balanced later.
```
>>> eq = chemeq("CuS + 8HNO3 = CuSO4 + 8NO2 + 4H2O")
  >>> eq.is_balanced
  True
  >>> eq = chemeq("73CuS + 73HNO3 = 11CuSO4 + 11NO2 + 11H2O")
  >>> eq.is_balanced
  False
  >>> eq.balance()
  >>> eq
<Balanced equation: "CuS + 8HNO3 = CuSO4 + 8NO2 + 4H2O">
```
```
  >>> from chemeq import periodic_table
  >>> periodic_table
                      name symbol  atomic_weight   error  group  period state
  atomic_number
  1               Hydrogen      H         1.0080  0.0002      1       1     g
  2                 Helium     He         4.0026  0.0001     18       1     g
  3                Lithium     Li         6.9400  0.0600      1       2     s
  4              Beryllium     Be         9.0122  0.0001      2       2     s
  5                  Boron      B        10.8100  0.0200     13       2     s
  ...                  ...    ...            ...     ...    ...     ...   ...
  79                  Gold     Au       196.9700  0.0100     11       6     s
  80               Mercury     Hg       200.5900  0.0100     12       6     l
  81              Thallium     Tl       204.3800  0.0100     13       6     s
  82                  Lead     Pb       207.2000  1.1000     14       6     s
  83               Bismuth     Bi       208.9800  0.0100     15       6     s
  [67 rows x 7 columns]
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/elbiop/chemeq",
    "name": "chemeq",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">= 3.6",
    "maintainer_email": "",
    "keywords": "chemistry,chemical,chemicals,equation,equations,balance,balancer,balancing,reaction,reactions,periodic table,elements",
    "author": "Elbio Pe\u00f1a",
    "author_email": "elbioemilio@outlook.es",
    "download_url": "https://files.pythonhosted.org/packages/e0/aa/60b514f8c6051bf41afb0640f3abd155f4e4facd40624104872295e1327b/chemeq-0.1.7.tar.gz",
    "platform": null,
    "description": "\r\nPackage capable of balance chemical equations and contains the most used portion of the periodic table of elements.   \r\nThe package has two objects: **chemeq** and **periodic_table**.   \r\n\r\n### 1. chemeq   \r\n&emsp; CLASS, Receives a string representing a chemical equation  as input.   \r\n&emsp; In the shape: \"reactant_1 + ... + reactant_n  = product_1 + ... + product_n\".   \r\n\r\n&emsp; The **chemeq CLASS** has three properties and one method.   \r\n\r\n&emsp;&emsp;      **is_balanced** : Property. Boolean (True or False)   \r\n&emsp;&emsp;      **reactants** &emsp;: Property. pandas.DtataFrame where each row represents one of the reactants (left side)   \r\n&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;   compounds,  molecular weights and elements.   \r\n&emsp;&emsp;      **products** &emsp; : Property. pandas.DtataFrame where each row represents one of the product (right side)   \r\n&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;   compounds, molecular weights and elements.   \r\n&emsp;&emsp;      **balance()** &emsp; : Method. Balances the equation if it is unbalanced.   \r\n\r\n\r\n### 2. periodic_table   \r\n&emsp;  pandas.DataFrame containing a portion of the periodic table of elements contains: Z, name, symbol, atomic mass,   \r\n&emsp;  atomic mass error, period, group & state.   \r\n\r\n&emsp;     Source for the periodic table of elements:   \r\n&emsp;     IUPAC - International Union of Pure and Applied Chemistry   \r\n&emsp;     https://iupac.org/what-we-do/periodic-table-of-elements/   \r\n\r\n## LIMITATIONS   \r\n- Does not include Rare earths, synthetic elements, Radon, Francium & Radium.   \r\n- Intermediate prefixes like those from hydrates such as Cu(SO4)\u00e2\u20ac\u00a25H2O   \r\n&emsp; must be represented with subindexes like Cu(SO4)(H2O)5.   \r\n\r\n## EXAMPLES   \r\n```\r\n  >>> from chemeq import chemeq\r\n  >>> eq = chemeq(\"C2H5(OH) + O2 = CO2 + H2O\")\r\n  >>> eq.is_balanced\r\n  False\r\n```\r\n  The balance status of the equation is also visible in the equation object itself.\r\n```\r\n  >>> eq\r\n  <Unbalanced equation: \"C2H5(OH) + O2 = CO2 + H2O\">\r\n```\r\n  To balance the equation invoke the balance() method\r\n```\r\n>>> eq.balance()\r\n  >>> eq.is_balanced\r\n  True\r\n  >>> eq\r\n  <Balanced equation: \"C2H5(OH) + 3O2 = 2CO2 + 3H2O\">\r\n```\r\nExample of its properties\r\n```\r\n  >>> str(eq)\r\n  \"C2H5(OH) + 3O2 = 2CO2 + 3H2O\"\r\n  >>> eq.reactants\r\n     coefficient   formula  C  H  O  Mass(g/mol)\r\n  0            1  C2H5(OH)  2  6  1       46.069\r\n  1            3        O2  0  0  2       31.998\r\n  >>> eq.products\r\n     coefficient formula  C  H  O  Mass(g/mol)\r\n  0            2     CO2  1  0  2       44.009\r\n  1            3     H2O  0  2  1       18.015</pre>\r\n```\r\n\r\n  An equation can be created with their indexes to test if it is balanced. If it is not it can be balanced later.\r\n```\r\n>>> eq = chemeq(\"CuS + 8HNO3 = CuSO4 + 8NO2 + 4H2O\")\r\n  >>> eq.is_balanced\r\n  True\r\n  >>> eq = chemeq(\"73CuS + 73HNO3 = 11CuSO4 + 11NO2 + 11H2O\")\r\n  >>> eq.is_balanced\r\n  False\r\n  >>> eq.balance()\r\n  >>> eq\r\n<Balanced equation: \"CuS + 8HNO3 = CuSO4 + 8NO2 + 4H2O\">\r\n```\r\n```\r\n  >>> from chemeq import periodic_table\r\n  >>> periodic_table\r\n                      name symbol  atomic_weight   error  group  period state\r\n  atomic_number\r\n  1               Hydrogen      H         1.0080  0.0002      1       1     g\r\n  2                 Helium     He         4.0026  0.0001     18       1     g\r\n  3                Lithium     Li         6.9400  0.0600      1       2     s\r\n  4              Beryllium     Be         9.0122  0.0001      2       2     s\r\n  5                  Boron      B        10.8100  0.0200     13       2     s\r\n  ...                  ...    ...            ...     ...    ...     ...   ...\r\n  79                  Gold     Au       196.9700  0.0100     11       6     s\r\n  80               Mercury     Hg       200.5900  0.0100     12       6     l\r\n  81              Thallium     Tl       204.3800  0.0100     13       6     s\r\n  82                  Lead     Pb       207.2000  1.1000     14       6     s\r\n  83               Bismuth     Bi       208.9800  0.0100     15       6     s\r\n  [67 rows x 7 columns]\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Balance chemical equations & calculates molecular weights plus periodic table of elements",
    "version": "0.1.7",
    "split_keywords": [
        "chemistry",
        "chemical",
        "chemicals",
        "equation",
        "equations",
        "balance",
        "balancer",
        "balancing",
        "reaction",
        "reactions",
        "periodic table",
        "elements"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ead89b74c29a3a5774ae4b58e82d8d1a787a129d10c632b1349eb3da277e919d",
                "md5": "a03a0ba8afb673afcc09fabb3b316c33",
                "sha256": "82de1938d358bd5f27742425ab16154834236bff6488ae5dee091e8fde631550"
            },
            "downloads": -1,
            "filename": "chemeq-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a03a0ba8afb673afcc09fabb3b316c33",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">= 3.6",
            "size": 12620,
            "upload_time": "2023-04-18T09:42:36",
            "upload_time_iso_8601": "2023-04-18T09:42:36.518153Z",
            "url": "https://files.pythonhosted.org/packages/ea/d8/9b74c29a3a5774ae4b58e82d8d1a787a129d10c632b1349eb3da277e919d/chemeq-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e0aa60b514f8c6051bf41afb0640f3abd155f4e4facd40624104872295e1327b",
                "md5": "bc432f4fe1680e9ef1697c692a6929e1",
                "sha256": "f26ddd238e90094d1c9279bdb920199c7e573cc19a4fa2414734459720dd5943"
            },
            "downloads": -1,
            "filename": "chemeq-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "bc432f4fe1680e9ef1697c692a6929e1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">= 3.6",
            "size": 14017,
            "upload_time": "2023-04-18T09:42:39",
            "upload_time_iso_8601": "2023-04-18T09:42:39.270097Z",
            "url": "https://files.pythonhosted.org/packages/e0/aa/60b514f8c6051bf41afb0640f3abd155f4e4facd40624104872295e1327b/chemeq-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-18 09:42:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "elbiop",
    "github_project": "chemeq",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "chemeq"
}
        
Elapsed time: 0.06804s