{"id":23204670,"url":"https://github.com/prheenan/mol_from_text","last_synced_at":"2025-10-16T18:15:34.704Z","repository":{"id":268303290,"uuid":"902095304","full_name":"prheenan/mol_from_text","owner":"prheenan","description":"Turn text into molecular images!","archived":false,"fork":false,"pushed_at":"2024-12-28T21:28:21.000Z","size":1771,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-17T21:12:09.227Z","etag":null,"topics":["chemistry","fun","molecule","python","rdkit"],"latest_commit_sha":null,"homepage":"","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/prheenan.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}},"created_at":"2024-12-11T22:34:45.000Z","updated_at":"2024-12-28T21:28:25.000Z","dependencies_parsed_at":"2024-12-15T23:18:21.695Z","dependency_job_id":"edf219fc-3e1c-4352-a45c-dd0a5077ddb5","html_url":"https://github.com/prheenan/mol_from_text","commit_stats":null,"previous_names":["prheenan/mol_from_text"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prheenan%2Fmol_from_text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prheenan%2Fmol_from_text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prheenan%2Fmol_from_text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prheenan%2Fmol_from_text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prheenan","download_url":"https://codeload.github.com/prheenan/mol_from_text/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247320035,"owners_count":20919700,"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":["chemistry","fun","molecule","python","rdkit"],"created_at":"2024-12-18T16:19:42.237Z","updated_at":"2025-10-16T18:15:29.659Z","avatar_url":"https://github.com/prheenan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Motivation\n!['4fun' text with letters as molecular structures](Docs/4fun.gif)\n\nWe all love rdkit, but hasn't it always been missing a 'MolFromText' function to turn text into structures?\n\nWouldn't that be cool? Anybody think so? Bueller? No?\n\nWell, here is one anyway!\n\n# Nuts and bolts\n\n`mol_from_text` is a python module which enables representing text as molecules and includes:\n\n- optional fun colors\n- optional (even more) fun animations\n- compatability with ASCII codes 32-126 (uppercase only; lowercase TBD)\n\nBelow are the supported characters and their representation:\n\n    ~|}{`_^][\\@?=\u003e\u003c;:/.-,+*)('\"'\"'\u0026%$#\"!9876543210ZYXWVUTSRQPONMLKJIHGFEDCBA\n\n![listing of all available characters](Docs/all_chars.svg)\n\n\n# Installation\n\n    git clone https://github.com/prheenan/mol_from_text.git\n    cd mol_from_text\n    conda env create --force --yes -f env.yaml\n    conda activate mol_ransom\n\n# Testing\n\n    conda activate mol_ransom\n    python test.py\n\n# Usage\n\n## Making images\n\nImages can be created as follows:\n\n`python mol_from_text.py image  --string 'helloworld'`\n\nThis yields the image below as `helloworld.svg`:\n\n![hello world image with letters as molecular structures](Docs/helloworld.svg)\n\nThere are many options for modifying the image as given below:\n\n    Usage: mol_from_text.py image [OPTIONS]\n\n    Options:\n      --string TEXT                   What string to convert to molecules\n                                      [required]\n      --output_file PATH              Name of output file (only png and svg\n                                      supported)\n      --black_and_white Choice([TRUE/True/FALSE/False])\n                                      If true, use black and white instead of\n                                      colors\n      --comic_mode Choice([TRUE/True/FALSE/False])\n                                      If true, use comic-drawing mode (xkcd style)\n      --letters_per_row INTEGER       How many letters per row (i.e., line\n                                      character limit)\n      --one_word_per_line Choice([TRUE/True/FALSE/False])\n                                      If true, have one word per row/line\n                                      (equivalent to setting \u003cletters_per_row\u003e to\n                                      the longest word length)\n      --dots_per_angstrom FLOAT       See rdkit.Draw.MolDrawOptions\n      --font_size INTEGER             See rdkit.Draw.MolDrawOptions\n      --bond_width FLOAT              See rdkit.Draw.MolDrawOptions\n      --scale FLOAT                   See rdkit.Draw.MolDrawOptions\n      --letter_size_pixels INTEGER    Individual size of letters\n      --help                          Show this message and exit.\n\n\n\n## Making animations\n\n\nImages can be created as follows:\n\n`python mol_from_text.py animate  --string 'helloworld'`\n\nThis yields the image below as `helloworld.gif`:\n\n![animated hello world image with letters as molecular structures](Docs/helloworld.gif)\n\nThere are many animations options as follows:\n\n    Usage: mol_from_text.py animate [OPTIONS]\n\n    Options:\n      --output_file PATH              Name of output file (only gif supported)\n      --string TEXT                   What string to convert to molecules\n                                      [required]\n      --black_and_white Choice([TRUE/True/FALSE/False])\n                                      If true, use black and white instead of\n                                      colors\n      --comic_mode Choice([TRUE/True/FALSE/False])\n                                      If true, use comic-drawing mode (xkcd style)\n      --letters_per_row INTEGER       How many letters per row (i.e., line\n                                      character limit)\n      --one_word_per_line Choice([TRUE/True/FALSE/False])\n                                      If true, have one word per row/line\n                                      (equivalent to setting \u003cletters_per_row\u003e to\n                                      the longest word length)\n      --loop_forever Choice([TRUE/True/FALSE/False])\n                                      If true, loop for forever, otherwise just\n                                      will run once\n      --and_reverse Choice([TRUE/True/FALSE/False])\n                                      If true, animation will run in forward\n                                      direction then in the reverse direction\n      --total_time_s FLOAT            How long for total animation\n      --rotation_degrees FLOAT        Total rotation in degrees\n      --frames_per_second FLOAT       How many frames per second\n      --start_degrees FLOAT           Where to start animation (0 = 12 o clock,\n                                      -90 would be 9 o clock, +90 would be 3 o\n                                      clock, etc)\n      --dots_per_angstrom FLOAT       See rdkit.Draw.MolDrawOptions\n      --font_size INTEGER             See rdkit.Draw.MolDrawOptions\n      --bond_width FLOAT              See rdkit.Draw.MolDrawOptions\n      --scale FLOAT                   See rdkit.Draw.MolDrawOptions\n      --letter_size_pixels INTEGER    Individual size of letters\n      --help                          Show this message and exit.\n\n\n##  Getting a molfile\n\nIf you just want a molfile of all the letters and their structures, that is easy enough:\n\n`python mol_from_text.py export-structures --output_file \"mols.sdf\"`\n\nThis will export an SDF which as a `ascii_character` property for each molecule containing its text\n\n## Future directions\n\n- Support for lowercase? (ASCII 97-122)\n- Incorporate [NanoPutian](https://en.wikipedia.org/wiki/NanoPutian)?\n- Randomly change atoms during animations\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprheenan%2Fmol_from_text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprheenan%2Fmol_from_text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprheenan%2Fmol_from_text/lists"}