{"id":38335027,"url":"https://github.com/cedergrouphub/reactioncompleter","last_synced_at":"2026-01-17T02:55:38.386Z","repository":{"id":92994741,"uuid":"198871640","full_name":"CederGroupHub/ReactionCompleter","owner":"CederGroupHub","description":"Heuristics to complete a chemical reaction","archived":false,"fork":false,"pushed_at":"2021-03-25T03:02:22.000Z","size":52,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-09T23:38:59.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/CederGroupHub.png","metadata":{"files":{"readme":"README.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-07-25T17:07:23.000Z","updated_at":"2023-05-21T17:02:02.000Z","dependencies_parsed_at":"2023-05-04T08:47:10.547Z","dependency_job_id":null,"html_url":"https://github.com/CederGroupHub/ReactionCompleter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CederGroupHub/ReactionCompleter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CederGroupHub%2FReactionCompleter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CederGroupHub%2FReactionCompleter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CederGroupHub%2FReactionCompleter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CederGroupHub%2FReactionCompleter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CederGroupHub","download_url":"https://codeload.github.com/CederGroupHub/ReactionCompleter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CederGroupHub%2FReactionCompleter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-17T02:55:37.442Z","updated_at":"2026-01-17T02:55:38.382Z","avatar_url":"https://github.com/CederGroupHub.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ReactionCompleter\n\nThis module computes valid chemical reactions using list of precursor \nand target materials. It is capable of using some simple heuristics to\ncomplete or guess missing or excessive materials in the given lists of\nmaterials.\n\n[![Build Status](https://semaphoreci.com/api/v1/projects/648bbb02-9eb5-4cce-9642-16eb7108f2fa/2831982/badge.svg)](https://semaphoreci.com/cedergrouphub/reactioncompleter)\n\n# Usage\n\nThe primary function to be used is \n`balance_recipe(precursors, targets, synthesis_paragraph)`. An example\nis as follows:\n\n```python\nfrom reaction_completer import balance_recipe\n\n\nprecursors = [\n    {\n        \"material_formula\": \"SrCO3\",\n        \"material_string\": \"SrCO3\",\n        \"composition\": [\n            {\n                \"formula\": \"SrCO3\",\n                \"elements\": {\"Sr\": \"1.0\", \"C\": \"1.0\", \"O\": \"3.0\"},\n                \"amount\": \"1.0\"\n            }\n        ],\n    },\n    {\n        \"material_formula\": \"Al2O3\",\n        \"material_string\": \"Al2O3\",\n        \"composition\": [\n            {\n                \"formula\": \"Al2O3\",\n                \"elements\": {\"Al\": \"2.0\", \"O\": \"3.0\"},\n                \"amount\": \"1.0\"\n            }\n        ],\n    },\n    {\n        \"material_formula\": \"MnO\",\n        \"material_string\": \"MnO\",\n        \"composition\": [\n            {\n                \"formula\": \"MnO\",\n                \"elements\": {\"Mn\": \"1.0\", \"O\": \"1.0\"},\n                \"amount\": \"1.0\"\n            }\n        ],\n    },\n    {\n        \"material_formula\": \"Fe2O3\",\n        \"material_string\": \"Fe2O3\",\n        \"composition\": [\n            {\n                \"formula\": \"Fe2O3\",\n                \"elements\": {\"Fe\": \"2.0\", \"O\": \"3.0\"},\n                \"amount\": \"1.0\"\n            }\n        ],\n    },\n    {\n        \"material_formula\": \"ZrO2\",\n        \"material_string\": \"ZrO2\",\n        \"composition\": [\n            {\n                \"formula\": \"ZrO2\",\n                \"elements\": {\"Zr\": \"1.0\", \"O\": \"2.0\"},\n                \"amount\": \"1.0\"\n            }\n        ]\n    },\n    {\n        \"material_formula\": \"H2O\",\n        \"material_string\": \"H2O\",\n        \"composition\": [\n            {\n                \"formula\": \"H2O\",\n                \"elements\": {\"O\": \"1.0\", \"H\": \"2.0\"},\n                \"amount\": \"1.0\"\n            }\n        ]\n    },\n]\ntargets = [\n    {\n        \"material_formula\": \"Sr6(A2O4)6\",\n        \"material_string\": \"Sr6(A2O4)6\",\n        \"composition\": [\n            {\n                \"formula\": \"Sr6(Fe2O4)6\",\n                \"elements\": {\"A\": \"12.0\", \"O\": \"24.0\", \"Sr\": \"6.0\"},\n                \"amount\": \"1.0\"\n            }\n        ],\n        \"elements_vars\": {\n            \"A\": [\"Fe\", \"Al\"]\n        },\n        \"additives\": [\"Mn2+\"]\n    },\n]\ntext = [\n    \"SrCO3, Al2O3, MnO and Fe2O3 are used to synthesize Mn2+doped-Sr6(A2O4)6, A=Fe, Al.\",\n    \"Milling media is ZrO2\",\n    \"There is some H2O found in the final product.\"\n]\n\nreactions = balance_recipe(precursors, targets, text)\nprint('Found', len(reactions), 'reactions')\nfor reaction in reactions:\n    print(reaction)\n\n# Output:\n# [(\n#     'Sr6(A2O4)6', {\n#         'left': {'SrCO3': '6', 'Fe2O3': '6'},\n#         'right': {'Sr6(A2O4)6': '1', 'CO2': '6'}\n#     },\n#     {'A': 'Fe'},\n#     '6 SrCO3 + 6 Fe2O3 == 1 Sr6(A2O4)6 + 6 CO2; A = Fe ; target Sr6(A2O4)6 with additives Mn2+ via MnO'\n# ),\n# (\n#     'Sr6(A2O4)6', {\n#         'left': {'SrCO3': '6', 'Al2O3': '6'},\n#         'right': {'Sr6(A2O4)6': '1', 'CO2': '6'}\n#     },\n#     {'A': 'Al'},\n#     '6 SrCO3 + 6 Al2O3 == 1 Sr6(A2O4)6 + 6 CO2; A = Al ; target Sr6(A2O4)6 with additives Mn2+ via MnO'\n# )]\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedergrouphub%2Freactioncompleter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedergrouphub%2Freactioncompleter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedergrouphub%2Freactioncompleter/lists"}