{"id":16916847,"url":"https://github.com/harshil21/carbonpy","last_synced_at":"2025-07-22T03:36:50.137Z","repository":{"id":56225553,"uuid":"217586366","full_name":"harshil21/carbonpy","owner":"harshil21","description":"An Organic Chemistry module","archived":false,"fork":false,"pushed_at":"2023-03-26T14:39:44.000Z","size":69,"stargazers_count":16,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-16T19:53:15.687Z","etag":null,"topics":["bonds","carbon","chemistry","compound","iupac","organic-chemistry","pip","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harshil21.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":"2019-10-25T17:47:19.000Z","updated_at":"2025-04-24T03:01:01.000Z","dependencies_parsed_at":"2024-10-28T13:16:04.849Z","dependency_job_id":"3d2fda2c-2768-409e-9e5c-48216b43e1da","html_url":"https://github.com/harshil21/carbonpy","commit_stats":{"total_commits":33,"total_committers":4,"mean_commits":8.25,"dds":"0.24242424242424243","last_synced_commit":"c4ab6dfd7dd7c6b23557d814c9def2f510d69cf7"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/harshil21/carbonpy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshil21%2Fcarbonpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshil21%2Fcarbonpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshil21%2Fcarbonpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshil21%2Fcarbonpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harshil21","download_url":"https://codeload.github.com/harshil21/carbonpy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshil21%2Fcarbonpy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266420871,"owners_count":23926009,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bonds","carbon","chemistry","compound","iupac","organic-chemistry","pip","python3"],"created_at":"2024-10-13T19:30:28.148Z","updated_at":"2025-07-22T03:36:50.116Z","avatar_url":"https://github.com/harshil21.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Carbonpy\nA module which names straight/branched chain organic compounds, suggests conversions from one type to another, etc.\n\n[![Downloads](https://pepy.tech/badge/carbonpy)](https://pepy.tech/project/carbonpy) [![Downloads](https://pepy.tech/badge/carbonpy/month)](https://pepy.tech/project/carbonpy/month) [![Downloads](https://pepy.tech/badge/carbonpy/week)](https://pepy.tech/project/carbonpy/week) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/harshil21/carbonpy?color=orange)\n## Installation\n\n- You can install or upgrade carbonpy with:\n``` \n$ pip install carbonpy --upgrade\n```\n- Building from source:\n```\n$ git clone https://github.com/harshil21/carbonpy --recursive\n$ cd carbonpy\n$ python setup.py install\n```\n## Usage\n\n### Syntax for representing bonds:  \n\nSingle bond: -  \nDouble bond: =  \nTriple bond: ~  \n\nExamples: `CH3-CH3`, `CH2=CH2`, `CH~CH`\n\n### Naming compounds:\n\nInstantiate the class `Namer()` , which takes a string which contains the hydrocarbon (condensed form) and then call it with a method named `analyser()` to get the IUPAC name of the compound.\n\nExample:\n``` python\nfrom carbonpy import Namer\n\ncompound = Namer('CH~CH')\nprint(compound.analyser())\n\n\u003e\u003e\u003e 'Eth-1-yne'\n```\n\nYou can also get the molecular formula of a compound:\n```python\ncompound = Namer('CH~C-C~C-CH=C=C=CH2')\nprint(compound.molecular_formula())\n\u003e\u003e\u003e 'C₈H₄'\n```\n\nOr get the number of carbons/hydrogens in the compound by using the attributes:\n```python\ncompound = Namer('CH4')\ncarbs = compound.carbons\nhydros = compound.hydrogens\n\nprint(f\"Carbons: {carbs}, Hydrogens: {hydros}\")\n\n\u003e\u003e\u003e 'Carbons: 1, Hydrogens: 4'\n```\n\nOnce branches are supported, 2-Methylpropane would be expressed as:\n```\na = Namer('CH3-CH(CH3)-CH3').analyser()\n\u003e\u003e\u003e 2-Methylpropane\n```\n\nWill support naming with functional groups in the future.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshil21%2Fcarbonpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharshil21%2Fcarbonpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshil21%2Fcarbonpy/lists"}