{"id":15018296,"url":"https://github.com/dylanwal/chemistry_drawer","last_synced_at":"2026-02-14T12:01:04.285Z","repository":{"id":46880629,"uuid":"515718710","full_name":"dylanwal/chemistry_drawer","owner":"dylanwal","description":"Draw molecules with plotly!","archived":false,"fork":false,"pushed_at":"2025-12-14T17:14:38.000Z","size":1718,"stargazers_count":52,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T11:36:29.884Z","etag":null,"topics":["chemical","cheminformatics","chemistry","molecule","plotly","rdkit","smiles","structure"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dylanwal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-07-19T19:37:12.000Z","updated_at":"2025-12-15T05:18:15.000Z","dependencies_parsed_at":"2025-06-07T15:15:29.397Z","dependency_job_id":null,"html_url":"https://github.com/dylanwal/chemistry_drawer","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":0.1515151515151515,"last_synced_commit":"4fa69eeafa94c4cf2f4aaa0c37c71b6f3f93c3ca"},"previous_names":["dylanwal/chemdraw"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/dylanwal/chemistry_drawer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanwal%2Fchemistry_drawer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanwal%2Fchemistry_drawer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanwal%2Fchemistry_drawer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanwal%2Fchemistry_drawer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dylanwal","download_url":"https://codeload.github.com/dylanwal/chemistry_drawer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanwal%2Fchemistry_drawer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29443468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T10:51:12.367Z","status":"ssl_error","status_checked_at":"2026-02-14T10:50:52.088Z","response_time":53,"last_error":"SSL_read: 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":["chemical","cheminformatics","chemistry","molecule","plotly","rdkit","smiles","structure"],"created_at":"2024-09-24T19:51:48.106Z","updated_at":"2026-02-14T12:01:04.226Z","avatar_url":"https://github.com/dylanwal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chemistry Drawer\n\n---\n\n![PyPI](https://img.shields.io/pypi/v/chemdraw)\n![downloads](https://static.pepy.tech/badge/chemdraw)\n![license](https://img.shields.io/github/license/dylanwal/chemdraw)\n\nDraw molecules with [Plotly](https://github.com/plotly/plotly.py).\n\n**Make molecules look the way you want it!**\n\nThe package provides global control of aesthetics with `config`, and allows for local control by specifying details \nfor every atom, bond, and ring.\n\n\n(Development still in progress. So there are some bugs. But its working pretty well so far!)\n\n---\n\n## Installation\n\nPip installable package available.\n\n`pip install chemdraw`\n\n[pypi: chemdraw](https://pypi.org/project/chemdraw/)\n\n---\n---\n\n## Dependencies\n\n* [numpy](https://github.com/numpy/numpy) (1.23.1)\n  * Used for math\n* [plotly](https://github.com/plotly/plotly.py) (5.9.0)\n  * Plots molecules\n* [kaleido](https://github.com/plotly/Kaleido)  (0.1.0post1)\n  * Converts plotly graphs to images (png, svg, etc.)\n  * I am not using the most recent version of kaleido as it does not play nice with my computer. Try the newest \n    version, but if you are having issues install this specific version. \n* [rdkit](https://github.com/rdkit/rdkit) (2022.3.4)\n  * Convert SMILES to position coordinates.\n* [Pillow](https://github.com/python-pillow/Pillow) (9.2.0)\n  * Used for image manipulation.\n* [scikit-learn](https://github.com/scikit-learn/scikit-learn) (1.1.1)\n  * Used to reorient molecules.\n\n---\n---\n\n# Examples:\n(Image may be distorted from viewer, but real image is not.)\n\n\n## Basic Usage\n```python\nimport chemdraw\n\nmol = \"O=C(C)Oc1ccccc1C(=O)O\"\ndrawer = chemdraw.Drawer(mol, title=mol)\nfig = drawer.draw()\nfig.show()\n```\n\n![simple example](./examples/imgs/simple.svg)\n\n---\n## Grid\n\n\n```python\nimport chemdraw\n\nmolecules = [\n    \"CCCCCCCCCC\",\n    \"CC(CC(CCC)C)CC\",\n    \"CCC1CC1\",\n    \"C([C@@H]1[C@H]([C@@H]([C@H]([C@H](O1)O)O)O)O)O\",\n    \"O=C(C)Oc1ccccc1C(=O)O\",\n    \"C1(CCC2)=C3C2=CC4=C5C3=C(CCC5CCC4)C=C1\",\n    \"CC(C)(C)N(C)C(=O)C14C3C2C1C5C2C3C45C(=O)C69C8C7C6C%10C7C8C9%10\",\n    \"CC3C(C(=O)OCC1=CCN2C1C(CC2)OC(=O)C(CC(=O)O3)(C(C)C)O)(C(C)C)O\",\n    \"N#CCC1(CC(O1)C2=CC(=NC2=O)OC)O\"\n]\n\ndrawer = chemdraw.GridDrawer(molecules)\ndrawer.draw_png(\"example_2.png\")\n```\n\n![grid example](./examples/imgs/grid.png)\n\n---\n\n## Atom, Bond, and Ring Numbers\n\nAtom Numbers (black text) \n\nBond Numbers (gray text)\n\nRing Numbers (maroon text)\n\n```python\nimport chemdraw\n\nmol = \"C1(CCC2)=C3C2=CC4=C5C3=C(CCC5CCC4)C=C1\"\n\nconfig = chemdraw.Config()\nconfig.atom_numbers.show = True\nconfig.bond_numbers.show = True\nconfig.ring_numbers.show = True\n\ndrawer = chemdraw.Drawer(mol, title=mol, config=config)\nfig = drawer.draw()\nfig.show()\n\n```\n\n\n![atom bond example](./examples/imgs/atom_bond_numbers.svg)\n\n\n---\n\n## Ring Highlights\n\n```python\nimport chemdraw\n\nmol = \"C1(CCC2)=C3C2=CC4=C5C3=C(CCC5CCC4)C=C1\"\n\nmolecule = chemdraw.Molecule(mol)\nfor ring in molecule.rings:\n  ring.highlight.show = True  # all rings are highlighted (with default highlight_color)\n  if ring.aromatic:  # highlighted aromatic green\n    ring.highlight.color = \"rgba(0,255,0,0.5)\"\n\ndrawer = chemdraw.Drawer(molecule, title=mol)\nfig = drawer.draw()\nfig.show()\n\n```\n\n![ring highlights](./examples/imgs/ring_highlights.svg)\n\n\n---\n## Atom and Bond Highlights\n\n```python\nimport chemdraw\n\nmol = \"C1(CCC2)=C3C2=CC4=C5C3=C(CCC5CCC4)C=C1\"\n\nmolecule = chemdraw.Molecule(mol)\n\n# highlight outer ring bonds and atoms\nbond_ids = [0, 1, 2, 19, 5, 6, 21, 15, 14, 13, 12, 11, 10, 16, 17, 18]\nfor id_ in bond_ids:\n  molecule.bonds[id_].highlight.show = True\nfor atom in molecule.atoms:\n  atom.highlight.show = True\n\n# highlight inner bonds and atoms\naccent_color = \"rgb(252,186,63)\"\nmolecule.bonds[8].highlight.show = True\nmolecule.bonds[8].highlight.color = accent_color\nmolecule.bonds[20].highlight.show = True\nmolecule.bonds[20].highlight.color = accent_color\natoms_ids = [4, 8, 9]\nfor id_ in atoms_ids:\n  molecule.atoms[id_].highlight.color = accent_color\n\ndrawer = chemdraw.Drawer(molecule, title=mol)\nfig = drawer.draw()\nfig.show()\n```\n\n![ring highlights](./examples/imgs/highlights.svg)\n\n---\n## Polymers\n\nFrom mole file\n```python\nimport chemdraw\n\nmole_file_name = \"ketcher_mol_file.txt\"\nmol = chemdraw.Molecule(mole_file=mole_file_name)\n\ndrawer = chemdraw.Drawer(mol)\nfig = drawer.draw()\nfig.show()\n```\n\n![polymer](./examples/imgs/polymer.svg)\n\n\nAdd parenthesis to a SMILES\n\n```python\nimport chemdraw\n\nmol = chemdraw.Molecule(\"OC(=O)CCCCC(=O)NCCCCCCN\")\nmol.add_parenthesis([0, 15], sub_script=\"n\")\n\ndrawer = chemdraw.Drawer(mol)\nfig = drawer.draw()\nfig.show()\n```\n\n![polymer2](./examples/imgs/polymer2.svg)\n\n---\n---\n\n# Mole Files\n\nYou can also pass a file path to mole files into 'Molecule'. \nSupport for V2000 only.\n\n```python\nimport chemdraw\n\nmole_file_name = \"examples/mol_files/poly_diblock.txt\"\nmol = chemdraw.Molecule(mole_file=mole_file_name)\n\nmolecule_drawer = chemdraw.Drawer(mol)\nfig = molecule_drawer.draw()\nfig.show()\n```\n\n\n# More Info\n\nFor more information on how the code works see: \n[chemdraw.README.md](https://github.com/dylanwal/chemdraw/tree/master/chemdraw) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylanwal%2Fchemistry_drawer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdylanwal%2Fchemistry_drawer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylanwal%2Fchemistry_drawer/lists"}