{"id":26228931,"url":"https://github.com/thunderpoot/cliptoe","last_synced_at":"2025-04-19T18:02:17.686Z","repository":{"id":163409007,"uuid":"439147137","full_name":"thunderpoot/cliptoe","owner":"thunderpoot","description":"Command Line Interactive Periodic Table of Elements in multiple languages","archived":false,"fork":false,"pushed_at":"2023-03-28T11:32:59.000Z","size":154,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-02T04:07:44.708Z","etag":null,"topics":["atoms-in-molecules","calculator","chemistry","color","colors","colour","colours","command-line","command-line-tool","education","educational","golang","molecular","molecule","periodic-elements","periodic-table","periodic-table-of-elements","perl","python","telebasic"],"latest_commit_sha":null,"homepage":"","language":"BASIC","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/thunderpoot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"thunderpoot","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2021-12-16T22:48:05.000Z","updated_at":"2023-03-06T09:14:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"d69fde4d-7c33-41dd-a159-152029fbde17","html_url":"https://github.com/thunderpoot/cliptoe","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/thunderpoot%2Fcliptoe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunderpoot%2Fcliptoe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunderpoot%2Fcliptoe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunderpoot%2Fcliptoe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thunderpoot","download_url":"https://codeload.github.com/thunderpoot/cliptoe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243300137,"owners_count":20269251,"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":["atoms-in-molecules","calculator","chemistry","color","colors","colour","colours","command-line","command-line-tool","education","educational","golang","molecular","molecule","periodic-elements","periodic-table","periodic-table-of-elements","perl","python","telebasic"],"created_at":"2025-03-12T21:34:33.247Z","updated_at":"2025-03-12T21:34:33.853Z","avatar_url":"https://github.com/thunderpoot.png","language":"BASIC","funding_links":["https://github.com/sponsors/thunderpoot"],"categories":[],"sub_categories":[],"readme":"[![Go](https://img.shields.io/badge/go-%2300ADD8.svg?style=for-the-badge\u0026logo=go\u0026logoColor=white)](https://github.com/thunderpoot/cliptoe/tree/main/golang)\n[![HTML5](https://img.shields.io/badge/html5-%23E34F26.svg?style=for-the-badge\u0026logo=html5\u0026logoColor=white)](https://github.com/thunderpoot/cliptoe/tree/main/web)\n[![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge\u0026logo=javascript\u0026logoColor=%23F7DF1E)](https://github.com/thunderpoot/cliptoe/tree/main/web)\n[![Perl](https://img.shields.io/badge/perl-%2339457E.svg?style=for-the-badge\u0026logo=perl\u0026logoColor=white)](https://github.com/thunderpoot/cliptoe/tree/main/perl)\n[![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54)](https://github.com/thunderpoot/cliptoe/tree/main/python)\n[![TeleBASIC](https://raw.githubusercontent.com/telehack-foundation/.github/main/profile/svg/telebasic.svg)](https://github.com/thunderpoot/cliptoe/tree/main/telebasic)\n\n![CLI](https://telehack.com/cmd.svg)\n\n# cliptoe\nCommand Line Periodic Table of Elements\n\n![example_gif](https://user-images.githubusercontent.com/54200401/146476909-0a99cc8e-73b7-41ee-9ca6-74fe06c93858.gif)\n\n### What is it?\n\n - Highlight elements on Periodic Table\n - Parse chemical formulas\n - Calculate atomic mass of compounds\n\nWeb-UI also available [here](https://underwood.network/ptoe).\n\n## Usage\n\n```\n$ cliptoe -h\nCommand Line Interactive Periodic Table of Elements\n\nUsage:\ncliptoe [atom]         show details for element by atomic symbol or number\ncliptoe [compound]     list elements in compound\n\nOptions:\ncliptoe --animate=\u003cn\u003e  scroll through colours, speed is \u003cn\u003e\ncliptoe --var=\u003cn\u003e      set colour variation\ncliptoe --ind=\u003cn\u003e      set colour start index\ncliptoe --label        show period and group labels\ncliptoe --compounds    show list of example compounds\ncliptoe --key          show colour key\ncliptoe --table        show table / highlight elements on table\ncliptoe --mono         disable colours\n```\n\n## Examples\n\n\u003cimg width=\"796\" alt=\"Screenshot\" src=\"https://user-images.githubusercontent.com/54200401/146478333-0c055e48-503f-4038-afba-a7b451684524.png\"\u003e\n\n\u003cimg width=\"797\" alt=\"Screenshot\" src=\"https://user-images.githubusercontent.com/54200401/146463348-203dc15b-2afc-4971-863c-f53712fbe4c0.png\"\u003e\n\n\u003cimg width=\"796\" alt=\"Screenshot\" src=\"https://user-images.githubusercontent.com/54200401/146476257-dd5d420f-5c7c-4987-b6fc-089632c800ee.png\"\u003e\n\n\u003cbr\u003e\n\n## Concept\nThe idea was originally a [TeleBASIC](https://github.com/telehack-foundation/.github/blob/main/basic.md) code-golf exercise, then was ported to Perl.\nThe example screenshots are from the Perl version.\n\nRecreating this program in whatever language has been helpful for me in familiarising myself with syntax,\nusing the same (fairly naïve) approaches.  I plan to add more 'translations' eventually.\n\nIn Perl, the `ptoe_parse_input` function turns a chemical formula into its component items:\n```perl\nsub ptoe_parse_input\n{\n    my ( $query ) = @_;\n\n    # Parse chemical formula, input a string and get an array\n    # e.g 'H2O' =\u003e $VAR1 = [ 'H', '2' ]; $VAR2 = [ 'O', '1' ];\n\n    my @elem;\n    while ( $query =~ /([A-Z][a-z]?)([0-9]+)?/g )\n    {\n        my $element = $1;\n        my $many    = $2;\n        $many = '1' if !$many;\n        push @elem, [ $element, $many ];\n    }\n\n    return @elem;\n}\n```\n```\n$ cliptoe -d C21H30O2\n$VAR1 = [\n          [\n            'C',\n            '21'\n          ],\n          [\n            'H',\n            '30'\n          ],\n          [\n            'O',\n            '2'\n          ]\n        ];\n\n$ cliptoe -d NaHCO3\n$VAR1 = [\n          [\n            'Na',\n            '1'\n          ],\n          [\n            'H',\n            '1'\n          ],\n          [\n            'C',\n            '1'\n          ],\n          [\n            'O',\n            '3'\n          ]\n        ];\n$\n```\n\n## Caveats / Disclaimer\nThese programs are only able to handle formulas like `C15H31N3O13P2`, formulas like `Fe2(SO4)3` are not supported (yet).\nI'm not a chemist, and there are probably all kinds of bugs / problems that I'm not aware of.\nI plan to address any such issues to the best of my ability, but cannot make any promises.\n\n## Thanks\n[@telnet23](https://github.com/telnet23)\n[@kelturio](https://github.com/Kelturio)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunderpoot%2Fcliptoe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthunderpoot%2Fcliptoe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunderpoot%2Fcliptoe/lists"}