{"id":18390537,"url":"https://github.com/gitcordier/thechemicalbrowsers","last_synced_at":"2025-04-12T06:58:31.595Z","repository":{"id":112642270,"uuid":"139454257","full_name":"gitcordier/TheChemicalBrowsers","owner":"gitcordier","description":"Given a chemical formula, find how many H, He, Li, Be, B, C, N, ... are involved. Iterative algorithm, not the naive one!","archived":false,"fork":false,"pushed_at":"2020-07-23T20:11:41.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-12T06:58:24.395Z","etag":null,"topics":["chemical-formula","iterative-algorithms","parser"],"latest_commit_sha":null,"homepage":"","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/gitcordier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-07-02T14:26:19.000Z","updated_at":"2020-12-03T09:49:10.000Z","dependencies_parsed_at":"2023-06-10T09:30:29.895Z","dependency_job_id":null,"html_url":"https://github.com/gitcordier/TheChemicalBrowsers","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/gitcordier%2FTheChemicalBrowsers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitcordier%2FTheChemicalBrowsers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitcordier%2FTheChemicalBrowsers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitcordier%2FTheChemicalBrowsers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitcordier","download_url":"https://codeload.github.com/gitcordier/TheChemicalBrowsers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248530578,"owners_count":21119595,"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":["chemical-formula","iterative-algorithms","parser"],"created_at":"2024-11-06T01:48:19.835Z","updated_at":"2025-04-12T06:58:31.569Z","avatar_url":"https://github.com/gitcordier.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A chemical formula parser\nFor a given chemical formula represented by a string, parser counts the number \nof atoms of each element contained in the molecule and return a dict.\n\nFor example:\n\n```py\nwater = 'H2O'\nparse_molecule(water)              # Returns {'H': 2, 'O': 1}.\n\nmagnesium_hydroxide = 'Mg(OH)2'\nparse_molecule(magnesium_hydroxide)# Returns {'Mg': 1, 'O': 2, 'H': 2}.\n\nfremy_salt = 'K4[ON(SO3)2]2'\nparse_molecule(fremy_salt)         # Returns {'K': 4, 'O': 14, 'N': 2, 'S': 4}.\n```\nAs you can see, some formulas have brackets in them. \nThe index outside the brackets tells you that you have to multiply count of \neach atom inside the bracket on this index. \n\nFor example, in Fe(NO3)2 you have one iron atom, two nitrogen atoms and six \noxygen atoms.\n\nNote that brackets may be round, square or curly and can also be nested. \nIndex after the braces is optional.\n\n# How to use the parser.\nSimply run \"python parser.py\" (must be a python 3).\nAlternatively, you can run \"jupyter notebook\", so that Parser.ipynb gets run.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitcordier%2Fthechemicalbrowsers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitcordier%2Fthechemicalbrowsers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitcordier%2Fthechemicalbrowsers/lists"}