{"id":17579012,"url":"https://github.com/incognito124/chemeq","last_synced_at":"2025-04-12T22:54:06.113Z","repository":{"id":97240744,"uuid":"398912714","full_name":"InCogNiTo124/chemeq","owner":"InCogNiTo124","description":"Chemical equation balancer","archived":false,"fork":false,"pushed_at":"2024-06-01T23:58:02.000Z","size":8,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T16:55:10.756Z","etag":null,"topics":["cheminformatics","chemistry","cli","lark","lark-parser","linear-algebra","makefile","python3","sympy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InCogNiTo124.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-08-22T22:20:14.000Z","updated_at":"2022-11-26T07:08:37.000Z","dependencies_parsed_at":"2023-04-29T17:18:55.652Z","dependency_job_id":null,"html_url":"https://github.com/InCogNiTo124/chemeq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InCogNiTo124%2Fchemeq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InCogNiTo124%2Fchemeq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InCogNiTo124%2Fchemeq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InCogNiTo124%2Fchemeq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InCogNiTo124","download_url":"https://codeload.github.com/InCogNiTo124/chemeq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643045,"owners_count":21138353,"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":["cheminformatics","chemistry","cli","lark","lark-parser","linear-algebra","makefile","python3","sympy"],"created_at":"2024-10-22T00:25:05.526Z","updated_at":"2025-04-12T22:54:06.085Z","avatar_url":"https://github.com/InCogNiTo124.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chemical equation balancer\n\nBalance your chemical equations with ease!\n\n## Installation\n```\n$ git clone git@github.com:InCogNiTo124/chemeq.git \u0026\u0026 cd chemeq;\n$ python3 -m venv venv\n$ source venv/bin/activate\n$ (venv) pip install -r requirements/main.txt\n```\n\nOptionally, install `dev` dependencies inside the virtual environment and check the code:\n```\n$ (venv) pip install -r requirements/dev.txt\n$ (venv) make check\n```\n\n## Usage\n```\npython3 main.py -i ${INPUT_CHEM_1} ${INPUT_CHEM_2} ... -o ${OUTPUT_CHEM_1} ${OUTPUT_CHEM_2} ...\n```\nNote, there must be at least one input and at least one output.\n\n### Examples:\n```\n$ (venv) python3 main.py -i CH4 Cl2 -o CH3Cl H2\n2CH4 + Cl2 --\u003e 2CH3Cl + H2\n$ (venv) python3 main.py -i 'KOH' 'Co3(PO4)2' -o 'K3PO4' 'Co(OH)2'\n6KOH + Co3(PO4)2 --\u003e 2K3PO4 + 3Co(OH)2\n$ (venv) python3 main.py -i CH3CH2OH O2 -o CO2 H2O\nCH3CH2OH + 3O2 --\u003e 2CO2 + 3H2O\n```\n\n## How it works?\nThe idea is to write every molecule as a vector, such that the first dimension corresponds to one atom, the second for another etc. Then, both the left side and the right side can be though of as linear combination of vectors.\nAfter a short matrix calculation, it can be shown that the solution which balances the chemical equation is actually a basis vector in the nullspace of the system matrix.\n\nFor more details, try to figure out [https://en.wikipedia.org/wiki/Chemical\\_equation#Balancing\\_chemical\\_equations](https://en.wikipedia.org/wiki/Chemical_equation#Balancing_chemical_equations)\n\nI've actually come up with the idea on my own.\n\n# TODO:\n- Web deployment\n- Simpler implementation?\n- More docs? idk\n- Bugfixes? idk\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fincognito124%2Fchemeq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fincognito124%2Fchemeq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fincognito124%2Fchemeq/lists"}