Skip to main content

A Python package which gives IUPAC names of chemical compounds, classifies them and more.

Project description

Carbonpy

A module which names straight/branched chain organic compounds, suggests conversions from one type to another, etc.

Usage-

Naming compounds-

Instantiate 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.

Example:

a = Namer('CH~CH')
a.analyser()
>>> Ethyne

Due to limitations in expressing a hydrocarbon easily, we have selected this path
Single bond:- -
Double bond:- =
Triple bond:- ~
Branches:- -([compound] (more branches...))([another branch from same carbon])- and so on
(Branches support coming soon)

You can also get the molecular formula of the compound:

compound = Namer('CH~C-C~C-CH=C=C=CH2')
compound.molecular_formula()
>>> C₈H₄

Example- 2-Methylpropane would be expressed as (once branches are supported):

a = Namer('CH3-CH(CH3)-CH3').analyser()
>>> 2-Methylpropane

Will support naming with functional groups in the future.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carbonpy-0.52.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

carbonpy-0.52-py3-none-any.whl (11.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page